omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [SOLVED] Is there anyway to capture the input from keyboard?

    Pythonista
    question keyboard
    2
    4
    4212
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • goldenretrieume
      goldenretrieume last edited by goldenretrieume

      THIS QUESTION HAS BEEN SOLVED

      I want to capture all input from keyboard (including SHIFH, ALT, COMMAND and ARROW keys) in my app. Is there anyway to achieve this goal?

      My first idea is that putting invisible ui.TextView and move focus onto it, then watch the ui.TextView's buffer. Most input can get with this idea, but I cant capture special keys like SHIFT, CTRL, ALT and ARROW keys.

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        Using objc you can.

        See ShTerminal in shterminal.py in stash for a good example of this, which uses modifier keys, etc.

        Otherwise search the forums for keyCommands

        You can attach the callback to any UIResponder, which could be the main app, a textview, or any other general view.

        goldenretrieume 1 Reply Last reply Reply Quote 1
        • goldenretrieume
          goldenretrieume @JonB last edited by

          @JonB Thanks a lot for your quick suggestion! I'll read them and try.

          1 Reply Last reply Reply Quote 0
          • goldenretrieume
            goldenretrieume last edited by

            This question has been solved here. Thanks @JonB for giving me very helpful hint ☺️

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors