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.


    Keyboard switch.

    Pythonista
    5
    116
    46759
    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.
    • cvp
      cvp last edited by

      Even this does not work, it stops after one line

        def b_bottom_action(sender):
          while True:
            t = keyboard.get_input_context()
            if len(t[0]) == 0:
              break 
            keyboard.move_cursor(-len(t[0]))
      
      1 Reply Last reply Reply Quote 0
      • cvp
        cvp @shinya.ta last edited by cvp

        @shinya.ta New version here with buttons for

        • left one position
        • right one position
        • begin of line
        • end of line

        Sorry, not yet found a way to go top and bottom of text

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

          @cvp I could see that might not work., Without maybe a thread to keep moving?

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

            @JonB Thanks to try to help us (him? 😀). I don't understand how I could follow your advice.
            I've tried in the button's action to start a thread running the same loop, but no change

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

              @JonB But this works, not nice to see the cursor moving so slowly

              import time
              import threading
              class my_thread(threading.Thread):
                def __init__(self):
                  threading.Thread.__init__(self)
                def run(self):
                  while True:
                    t = keyboard.get_input_context()
                    if len(t[0]) == 0:
                      break 
                    keyboard.move_cursor(-len(t[0]))
                    time.sleep(0.0001)
              
              shinya.ta 1 Reply Last reply Reply Quote 0
              • JonB
                JonB last edited by

                Out of curiosity, what if you move_cursor(-10000) or something quite large... Does it only let you move the length of the context, or will it error if you go more than the textview would allow?

                cvp 2 Replies Last reply Reply Quote 0
                • shinya.ta
                  shinya.ta @cvp last edited by

                  @cvp

                  I tested.
                  This is wonderful.
                  If there is an up-and-down button, it is perfect.

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

                    @JonB I had tried very big moves, no error but no movement

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

                      @JonB this morning, weird effect, regardless of where the cursor is, it always descends to the same place, while the move parameter is negative. Perhaps, it is too early for my iPad 😊

                      1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @shinya.ta last edited by

                        @shinya.ta I'll try, but this evening

                        1 Reply Last reply Reply Quote 0
                        • cvp
                          cvp @shinya.ta last edited by cvp

                          @shinya.ta New version here with 6 buttons:

                          • left, right which seem ok
                          • beginning of document, end of document, up one line, down one line

                          But the process is not so good as hoped...
                          I've problems with keyboard.get_input_context that, sometimes 😢, returns texts of previous line, thus no way to compute length of texts at left and right of cursor because the texts are these ones of another line...

                          Thus, buttons are there, in some cases, it is ok, and in other cases not 😂
                          I agree that is not so pleasant, but try it at least.
                          Thanks

                          shinya.ta 2 Replies Last reply Reply Quote 0
                          • shinya.ta
                            shinya.ta @cvp last edited by

                            @cvp

                            I'll take a test.

                            Is it possible to make a page with only cursor movement?

                            https://imgur.com/a/7xrsx15

                            cvp 1 Reply Last reply Reply Quote 0
                            • shinya.ta
                              shinya.ta @cvp last edited by

                              @cvp

                              The top and bottom buttons don't move.
                              It doesn't seem to be good if the lines of the "文末" and "文頭" buttons are different.

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

                                @shinya-ta Do you know about the built in "track ball" mode of the iOS keyboard? Tap keyboard with two fingers (or maybe long press spacebar, might be different depending on device) then the keyboard becomes a trackball that you can drag around your finger to move cursor.

                                cvp shinya.ta 2 Replies Last reply Reply Quote 0
                                • cvp
                                  cvp @JonB last edited by

                                  @JonB Thanks to help me to try another solution 😀 because it is fastidious to develop a keyboard exactly as wanted...

                                  1 Reply Last reply Reply Quote 0
                                  • cvp
                                    cvp @shinya.ta last edited by

                                    @shinya.ta said:

                                    The top and bottom buttons don't move

                                    I told you I get problems with these buttons because the keyboard module does not work exactly as expected.

                                    1 Reply Last reply Reply Quote 0
                                    • cvp
                                      cvp @shinya.ta last edited by

                                      @shinya.ta said:

                                      Is it possible to make a page with only cursor movement?

                                      I'll try tomorrow, I stop for today

                                      1 Reply Last reply Reply Quote 0
                                      • shinya.ta
                                        shinya.ta @JonB last edited by

                                        @JonB

                                        I know that function, but it is very difficult to use.
                                        I would like to use the combination with the braille application I had made first for my wife who is totally blind.
                                        If I can do that, I can become happy with all my wife and I who are totally blind.

                                        cvp 1 Reply Last reply Reply Quote 0
                                        • cvp
                                          cvp @shinya.ta last edited by

                                          @shinya.ta New version here

                                          But, only to be sure that the layout is what you want. Could you check and try, please.

                                          I didn't understand the new key at bottom right of your picture, where I temporary put "???".

                                          Don't hope the keys do what you want, I've a lot of problems with the keyboard module.

                                          ⬅ = left one character
                                          ➡ = right one character
                                          文頭 = begin of sentence
                                          文末 = end of sentence
                                          ⬆ = up one line, but it is not entirely ok
                                          ⬇ = down one line, but is not entirely ok
                                          ??? = no action, and is entirely ok 😂

                                          I've let emoji's line, tell me if you don't want it.

                                          If no news, have a good week-end.

                                          PS For my curiosity, does your wife still use my (big) program for the Japanese Braille keyboard?

                                          shinya.ta 1 Reply Last reply Reply Quote 0
                                          • shinya.ta
                                            shinya.ta @cvp last edited by

                                            @cvp

                                            "" is delete button.
                                            It means delete in Japanese.
                                            This is also fine with Emoji.
                                            Everything is perfect.

                                            If possible, I want a copy button.

                                            My wife also uses the braille application.
                                            I use a braille application for a simple document and use an existing keyboard for using a difficult kanji.
                                            Therefore, this keyboard application is necessary for long sentences.

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