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.


    About the keyboard function keyboard.get_input_context()

    Pythonista
    keyboard
    3
    5
    1417
    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.
    • sanmaoban
      sanmaoban last edited by

      When I used the keyboard.get_input_context() function, I found that if I input a lot of Chinese characters (more than 5 Chinese characters) in the Google search page box, I found that the keyboard.get_input_context() function can only get the part of the input box I tried to move the cursor and continue to get the characters, but I can’t get any remaining characters. Is there any wise man who can get all the characters in the input box, can you help me answer?

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

        Do you mean the characters don't show up on the screen? Or that pulling the text doesn't give you everything you can see?

        sanmaoban 2 Replies Last reply Reply Quote 0
        • sanmaoban
          sanmaoban @JonB last edited by

          @JonB said:

          Do you mean the characters don't show up on the screen? Or that pulling the text doesn't give you everything you can see?

          Sorry, maybe I didn’t express it clearly. I want to write a script to capture the characters I just typed in the Google search box. When I type English characters, the script runs normally, but when I type more than five Chinese characters When writing characters, this script cannot get all the characters. Can you help me find out what went wrong? The script is relatively simple, I put the captured input characters in the variable input_str

          import keyboard
          input_str=''
          a=keyboard.get_input_context()[0]
          while (isinstance(a,str)):
          	input_str=a+input_str
          	keyboard.move_cursor(-len(a))
          	a=keyboard.get_input_context()[0]
          keyboard.move_cursor(len(input_str))
          
          1 Reply Last reply Reply Quote 0
          • sanmaoban
            sanmaoban @JonB last edited by sanmaoban

            @JonB
            I am very sorry because my English is not very good,In order to better describe this problem,I want to show this problem with pictures, but I don’t know how to send it to,I posted a photo on Twitter. In the photo, you can see that not all the characters are intercepted. I want to get all the Chinese characters. If it is convenient for you, I hope you can take a look.I used examples\keyboard\ KB Info.py in pythonista,thank youlink twitter url

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

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors