does “Xojo for iOS” support the use of external (wired or BT) keyboards on iPad apps?
If so, how does one detect that an external keyboard is in used (since that would affect how/if you need to move things out of the way etc)
And if it CAN… can it detect (and if so how) the fact that a keyboard is plugged or unplugged while the app is running?
Does iOS provide bluetooth keyboard notifications like that to begin with?
External keyboard can also be of the wired variety, so the question was a bit generic…
Keyboard show event only fires when the app first starts, OR you are setting the virtual keyboard to be 1st responder… the EXTERNAL keyboard never fires this event. So “SHOW” fires when a virtual keyboard is active, and HIDE fires when a virtual or external resigns.
Virtual Resign -> Virtual 1st = [HIDE] then [SHOW]
Virtual Resign -> External 1st = [HIDE only]
External Resign -> Virtual 1st = [SHOW only]
I’ll play with your first idea and see what that does for me
It just works here. I created a test app with just a TextArea and pushed it to my Gen 4. With the keyboard attached, the onscreen keyboard did not appear when I tapped the area and I was able to type on my keyboard. When I turned the keyboard off and gave it 20 seconds to recognize the retire, my next tap brought up the onscreen keyboard.
EDIT - auto timeout on the keyboard is also recognized.
Is that what you were questioning?
it is not the action of the keyboard… it is determining WHICH keyboard… there are other things that need to be done depending on if the keyboard is internal or external.
and “20 seconds to retire”? a bit excessive isn’t it?
and EAAccessoryManager either doesn’t recognize non-BT devices, or doesn’t work in the simulator
The 20 sec was arbitrary - it may have been noticed immediately, I just waited.
As I re-read more of the thread I see that you are looking for the notifications. I’ve not gone there since I just let the internal functions manipulate the displays … :S
yes… I need to know that the user has plugged in or paired an external keyboard, or has unplugged/unpaired one
trying to relaibly cobble that from the Show/Hide notifications simply doesn’t work… it generates an unwanted event when the user is moving from one field to another (the same event as if they plugged in a keyboard)
Never underestimate the user. Squarely place the responsibility on him with a switch “external keyboard on/off” …
that is not a choice iOS gives you, it will use an external keyboard if it is there. There is no way for the app itself to allow the user a choice… (and I don’t mean I didn’t provide a way, I mean iOS does not provide a way), trust me I have spent 3 days scouring the 'Net for any iOS based solution in any language.
My problem is I NEED to know when they plug one in or unplug it. Things happen interally if there is or is not an external keyboard not only visually but logically .
The “typing” part I can deal with
Why does it matter? Maybe there is another way to accomplish whatever you are doing?
Is it really a problem if the virtual keyboard hides the bottom of the editor ?
it is… I had thought about that, but the method to autoscroll the cursor into view had issues, especailly when the cursor was near the end of the document.
But I think I solved it… I have the textfield “remember” the last keyboard it used (internal or external), and when it becomes1streponder, and the keyboard type has CHANGED, then I do something
So I use the above notifications to get the “current keyboard height” and pass that to the textfield events. Haven’t tested it yet, but it should work…
EDIT : that doesn’t work either, since the Show/Hide keyboard notificaitons come out AFTER the textfield has become 1st responder