KeyCode for Android Keyboard Microphone - kotlin

I have been looking for a way to manipulate the microphone on the keyboard of an Android. Currently I have a button that brings up the google Text to speech. It works fine. However I am debating on the functionality portion.
I wanted to the option a user can tap the button which works flawlessly. Then the option of tapping the mic on the keyboard. I figured that if speech was in place the mic would be used for the keyboard as well. However in my case it doesn’t work.
My question is can I simulate the keyboard microphone function. The answer is there is always an away. Then again since it’s not working by default do I have to set the function for the mic portion.
I am assuming that if I do it would be the same code code has the button mic I created in the design. I have looked for key codes and found numerous key codes for remotes and such. There is no microphone on there just
media-record
So is media record the keycode for the keyboard mic? All I am needing is the keycode for the mic nothing else. Also my main concern is that is the mic on the keyboard coded to standard. Which means custom keyboards and what not.
I am not sure what to do here, if there is a keycode I can manipulate or if it’s just developed by default only.
I think it would be easier to just hit the mic on the keyboard to talk and let google speech do it its thing, rather than tap off the keyboard and press my custom button to record.
Does anyone know the keycode that would allow me to manipulate the button. I don’t the how to do it, I just need to access the keycode. As I said I have several lists that has keycodes for the complete android phone, however none of the media codes works With default keyboard mic.
Any help would be appreciated.

Related

USB Headset Microphone Mute Button is not Synchronized with System Device Microphone Mute Checkbox in Both Directions Using VB.net and NAudio

I have a Dell Inspiron 3650 desktop running Microsoft Windows 10 Pro Version 10.0.18363 Build 18363.
I am using NAudio to mute and unmute my USB headset microphone programmatically using:
MicrophoneDevice.AudioEndpointVolume.Mute = True
MicrophoneDevice.AudioEndpointVolume.Mute = False
First, I need to show some screen captures that will help in understanding the problem and at the very bottom of this post I will ask questions so please bear with me.
In my system tray I have a speaker icon for “Dell Audio” which allows access to the adjustments of USB Headset with microphone.
This will display the dialog with the “Mute Checkbox”.
NAudio will check or uncheck the checkbox above without any problem using the following code:
MicrophoneDevice.AudioEndpointVolume.Mute = True
MicrophoneDevice.AudioEndpointVolume.Mute = False
So far so good, so let’s look now at the Headset’s Mute button:
The Behaviors
When NAudio mutes the Microphone the checkbox is checked rendering the Headset’s microphone mute button totally useless until NAudio is told to unmute which unchecks the checkbox and returns control to the Headset’s Mute Button. This is behavior I expect.
The problem is that when I Mute or Unmute with the Headset’s Mute Button it does not turn the checkbox on and off. This is what I would call unidirectional control of muting. What I need is Bidirectional muting.
You may ask: Why Do I Need Bidirectional Muting?
I am working on a voice driven program for the blind and I can't expect them to be able to turn off a checkbox in settings no more than I can have a visual queue showing them if the microphone is on or off. The only feedback I can give is sound effects and the computer talking to them.
Use Case Scenario
The mute checkbox is unchecked, headset mute button is muted.
The User is currently dictating a document.
The User un-mutes microphone and says “Hello World” pauses for a second.
The User says, “Stop Dictation”.
The User mutes the microphone with the headset button (this is the last action the user makes because he/she is done speaking).
The code wants to mute the microphone just in case the user forgot to mute it while the computer speaks to inform the user that it has in fact stopped dictation. The computer says “Dictation was Stopped” (we don’t want the microphone to pick up the computer’s voice in the event that the Headset Speaker volume is too high so we mute).
The code wants to keep the microphone muted until the user un-mutes the microphone with the headset button.
Oops the code can’t keep it muted because the Headset’s Mute Button will remain useless. The only choice the code has is to unmute the microphone.
This is a problem because the last thing the user did or intended to do was to mute the microphone with the Headset Button. As far as the user knows the microphone is still muted. In fact, the microphone is picking up everything in the room because the code had no choice but to unmute the microphone to return control to the Headset.
I know that was a mouth full but nevertheless an actual case I have run into.
Here is some very simplified code
Private Sub SpeechRecognition_SpeechRecognized(sender As Object, e As SpeechRecognizedEventArgs) Handles SpeechRecognition.SpeechRecognized
MicrophoneDevice.AudioEndpointVolume.Mute = True
My.Computer.Audio.Play(SoundsPath & "speaking.wav", AudioPlayMode.Background)
ModuleSystemVoice.Speak("Dictation has been stopped", 3)
''''''' If you uncomment the line below the microphone is unconditionally un-muted until
''''''' the user mutes it with the headset's mute button but in the mean time background
'''''''noise in the room could falsely trigger another SpeechRecognition_SpeechRecognized
'''''''event.
'''''''MicrophoneDevice.AudioEndpointVolume.Mute = False
End Sub
My Questions
Is there some code Win32 API or whatever that could handle intercepting the Headset’s mute Button?
Is this a fault in the Dell Driver?
Is this a design flaw in Windows 10 driver’s specification for USB devices?
I have a workaround using Microphone Volume 0-31 where:
Muted = 0
Unmuted = My.Settings.LastVolumeLevel
I would like your advice or opinion even if the result is “It’s Impossible using Headset Mute Button”
Thank you all in advance.
Found this trying to solve similar problem.
I suspect your headset, like mine, has an inline mute button (image is blocked from work computer). That button mutes your microphone at the headset controller, not via Windows control. This makes the headset plug-and-play for any OS, rather than requiring drivers.
I'm trying to work around it by creating another hardware mute button to toggle Windows mic mute (easy) and a mute light that shows Windows mic mute status (near impossible).

Bringing up the iPad keyboard which is predominantly symbols

Apologies in advance if this is answered but I genuinely couldn't find it. I'm trying to bring up the keyboard type on iPad which appears when pressing the "#+=" button. I've tried going through all the types on the docs and I'm sure that this wasn't successful. Am I missing something or does the user have to click this button every time?
Edit: this question was closed as "off-topic" because it didn't include code or ideas or what I've tried already... Therefore for a bit of extra detail, I used EVERY keyboard type that is available on the docs e.g.
theTextField.keyboardType = UIKeyboardTypeNumberPad;
This did not yield the results that I require, which is the keyboard plane that appears when you press the #+= button because I wanted users to go straight to that one.
Unfortunately, this is impossible. It's not a keyboard type you want, it's a keyboard plane. There is no public API to switch or in any way access the keyboard planes.
One solution could be to create your own keyboard with the symbols you want. Another solution would be to open the keyboard and then generate a touch event that will switch the keyboard plane. However, this would be complicated, non-portable and a bit dangerous.
You have no ability to affect the built-in keyboards.
You can however create your own custom input view which you would set on the inputView of your text editing view before you make it first responder. Then iOS will show this view instead.
Have a look at this project of mine which implemented a "Morse keyboard" (April Fool's joke), but demonstrates how to achieve a custom keyboard that still interacts with a text field as you'd expect. http://www.cocoanetics.com/2012/04/dtmorsekeyboard-tutorial/

keyboard not working on sl4a interpreter on samsung galaxy y s5360

The soft keyboard is not working on my mobile in the sl4a environment. The keyboard is present there but on taping the keys nothing happens. Please kindly help.
Try grabbing a different keyboard off the Play Store, such as Hacker's Keyboard (which is good for this kind of thing)

ios custom keyboard

Is it possible to change what each key does? I have a client application and the way it needs to work is that each key press is a command to send over the network. I do not need my keyboard to produce letters (the server will do this) when pressed but commands to the server. Currently I have this working by making a custom view that looks like a keyboard however it would look better if it was the ios default keyboard.
Of course I dont expect the code but I need a starting point. My current google searching hasnt gone to good. Maybe a link to an example or some documentation on how to do it.
notes: you will see the first answer below makes a good suggestion but it brings up another point. my keyboard needs to mask the keyboard of the server, so no .com button or any other out of the ordinary keys, so I would also need to edit the layout I guess.
Create a text field with a custom delegate, hide it and set it as the first responder. Then you can hook into the delegate methods to work out what was pressed.

How to detect external keyboard connectification in objective-c?

My application need to know are external keyboard connect or no. How could i do to know that? No Private API please. :)
If this is iOS related, I'm not sure why you'd want to detect this as the hardware keyboard acts exactly the same as the software keyboard (except with a few extra shortcuts for sound, brightness etc. which your app shouldn't use anyway).
If you're considering screen space, then the software keyboard will still send it's notifications when it is displayed or when it is hidden, so you can respond to those. For example, say you have the software keyboard up and then you connect your external keyboard. The software keyboard will hide, and will post the UIKeyboardWillHideNotification. So you can respond to that.