Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

keyboard() without showKeyboard()

edited June 2013 in Suggestions Posts: 129

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).

Comments

  • SimeonSimeon Admin Mod
    Posts: 4,958

    @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.

  • Posts: 129

    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.

  • Posts: 182

    @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.

  • Posts: 2,820

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

  • Posts: 129

    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.

  • Posts: 2,042

    @akaJag, you could lock the orientation

  • Posts: 129

    @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.

  • edited July 2013 Posts: 129

    My idea is is somewhat like follows

    if externalKeyboard() then
      showKeyboard()
    else
      hideKeyboard()
    end
    

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

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @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.

  • Posts: 580

    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: http://twolivesleft.com/Codea/Talk/discussion/2663/detecting-on-screen-keyboard-vs-hardware-keyboard#Item_6

  • Posts: 1,976

    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.)

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @toadkick that would really help out.

  • Posts: 129

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

  • Posts: 1,976

    @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.

  • Posts: 129

    I don't know, sounds helpful but unnessesary...

Sign In or Register to comment.