How to handle keyboard mic button event on iPhone - ios

I have this UISearchBar sits on top of self.view. With the default keyboard shown when it became first responder, I wonder if there's any way to pick up a touch event of the microphone button. Any help would be greatly appreciated.

You are viewing this microphone icon because your iPhone dictation is switched on under Settings>General>Keyboard>Dictation or Settings-->General-->Siri.
I think you can use text input mode to identify which input mode is currently going on.
UITextInputCurrentInputModeDidChangeNotification
Reference - https://developer.apple.com/documentation/uikit/uitextinputmode?language=objc

Related

Trying to make UI button interactable over input field when touch screen keyboard in enabled for iOS in unity3D

Its a chatting scene, i have an input field for typing message and beside it there is a send button. Now while touch screen keyboard is enabled i can not press the send button, first the keyboard goes downwards and then i have to click the send button. Any suggestion?
You can write a script for your input field that detects when the focus is inside of the GUI element, and check the TouchScreenKeyboard.visible variable to know when it is dismissed.

Adding Voice Dictation (microphone) to ToolBar

What i am trying to do is:
Add one button (Microphone image) in toolbar.
On click of that button, the iOS default voice dictation should get call.
Query: I assume that we can not call default voice dictation but want to confirm.
Is their any workaround or any approach to call voice dictation on click of button in toolbar?
(The query is that dictation button (Mic) get display in keyboard
(for textfield & textview)& on click of that button(Mic) dictation
functionality comes to play, can we add similar button (like Mic) to
toolbar (for textfield & textview) & on click of button dictation
functionality should comes to play.)
Thanks
Dictation is only possible in a text field, and can thus only be started from the keyboard (afaik). It is also not supported for all languages, so it depends on what keyboard is active.
Those buttons are usually seen in chat apps, where they record an audio clip without translating it to text.

App to detect when pause/play button is pressed

So I have been struggling for quite sometime trying to figure out how to have my app detect if the pause/play button was pressed to which I have a counter (uilabel) on my app to add and subtract when the play/pause button is pressed on the headset.
To clarify more , what I am trying to do is once my application detects the pause button on my headphones , it will then add one to my uilabel.. so the pause button would be assigned as a +1 controller for the label
My app does not have any multimedia or background loops as it is not intended for this purpose. I attempted to use the "UIEventTypeRemoteControl" with no luck since its technically not a remote. Any help would be greatly appreciated regarding this! Thank you

UITextView doesn't play click sound

In my app, I have created a UITextView and add to main view, but when it becomes first responder and start input, I can't hear keyboard click sound. Even I have enabled it in setting->sound, but still not work. Does anyone have idea on this? Thanks
Maybe you not enough pushing on keyboard? :)
SRSLY: sound not depends on UITextView, it depends on whether or not sound enabled and sound volume. AFAIK you can't control keyboard's click sound programmatically.
So you need to check your device sound settings.

Show virtual Keyboard when bluetooth keyboard connected?

I am building system for my company that use of a bluetooth RFID reader.
The problem is we cannot show the keyboard when the reader is connecting unless we turn it off.
But I saw this video
http://www.youtube.com/watch?v=0uRlIw5H0wE&feature=related
And I know we can modify the reader to temperately show the keyboard.
(Just like the button on Apple iOS keyboard)
We can ask the provider to taylor-made the reader. So we want to add a physical button on it.
Do anyone know the keycode of that button?
Can it be done just to add a button to send a keycode event???
The button that needs to be pressed is the eject button that's on a mac keyboard. I don't know what the key code is or even if you can send it. But I do know it is the eject button.
The iOS keyboard gets hidden when a bluetooth or some other physical keyboard gets connected.
I think that the button is causing the Bluetooth HID-keyboard profile to disconnect at the scanner (which in-turn enables the iOS keyboard)
I have added details on how to show both bluetooth keyboard(using HID profile) and device virtual keyboard here I want to force keyboard on with bluetooth device please check if it helps.

Resources