keyboard() without showKeyboard()

So I am struggeling with a semi-minor problem; I want to be able to gain keyboard events without have runned the showKeyboard() function. I might have brought this up before, but I really would like this feature. Of course this only makes sence if you got an external keyboard connected, I see this useful.

As a suggestion I would really like if a moderator or admin of twolivesleft saw this and comment their thought of this being implemented to Codea (unless it is already implemented or not even possible to implement).

@akaJag as soon as a text control is editable, iOS will show the keyboard unless there is an external keyboard connected.

If you use an external keyboard then Codea will not show the software keyboard.

But I would like a way to get the keyboard events without having to showKeyboard(). Or better; if there was a way to know if the keyboard is external, like a externalKeyboard() function.

@akaJag I’m pretty sure another member posted that Codea’s HEIGHT variable changes when the onscreen keyboard is active. Dont hold me to that though.

@Dalorbi - I don’t believe that’s correct. That would be nice, though.

It’s hard to count on the HEIGHT or WIDTH variables 'cause the orientation could’ve been changed and tricks the system that the keyboard is shown.

@akaJag, you could lock the orientation

@JakAttak Yea I could, but that could destroy a functionality of the app. And my idea is to check this condition once in a while.

My idea is is somewhat like follows

if externalKeyboard() then

Either that or that the keyboard() function can get events even tho the hideKeyboard() is active.

@akaJag I agree with you. I’m at a point on my ui that I’d really like to detect if an external keyboard is present. If it Is I do not need to move textboxes to viewable space.

I’d like to go one step further and say, what I would like is to know the height of the onscreen keyboard at the time it’s presented regardless of whether an external keyboard is present. Even with an external keyboard Codea still displays the top bar of Codea’s custom keys. Also, with the height information, that means we don’t have to have constants for keyboard heights for both orientations, with/without an external keyboard.

I actually proposed this awhile back:

You could use the function orientationChanged(newOrientation) to adjust the cached WIDTH and HEIGHT variables.

@Simeon setOrientation(orientation)? Sets the current orientation to a specific side and keeps it there until the user rotates their iPad. (To distinguish from supportedOrientations.)

@toadkick that would really help out.

@SkyTheCoder your suggestion on setOrientation() wouldn’t really work, once you set the orientation it will just flip back instantly’ish.

@akaJag If you read my suggestion all the way, you would see that when it sets the orientation, it will keep it at that orientation until the user rotates their iPad. Say the user is in portrait, and the program sets the orientation to landscape right. It will then stay in landscape right until the user manually rotates their device, such as to landscape left.

I don’t know, sounds helpful but unnessesary…