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 ui button.

    Pythonista
    2
    55
    23684
    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.
    • shinya.ta
      shinya.ta @cvp last edited by

      @cvp

      The same thing happened in the script on GitHub.

      Is it better to make a topic with another topic?

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

        @shinya.ta Ok, try first in this topic, but, please, give a maximum infos about the problem

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

          @cvp

          Dear.cvp

          I tried the spractin.
          I was able to do it well both on iPhone and iPad.

          Thank you very much.

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

            @cvp

            I'm a little greedy, but is it possible to use the following programs mixed?

            import ui
            from objc_util import *
            
            def NextFieldKeyInTextFieldKeyboard(view, button, background_color='lightgray'):
                # parameters: view = main view of textfields
                #                           button = ui.Button designed by user (size, title, image...)
                #                           background_color = background_color of InputAccessoryView
                # create ui.View for InputAccessoryView above keyboard
                v = ui.View()                                                   # view above keyboard
                v.background_color = background_color   # background_color of user choice
                v.width = ui.get_screen_size()[0]           # width of screen, thus of keyboard
                v.height = button.height + 4                    # only for Next button
            
                # code executed when Next key is tapped
                def Next_tapped(sender):
                    s = sender.objc_instance.firstResponder()._nextKeyResponder().becomeFirstResponder()    
                button.action = Next_tapped                     # code to be executed if button tapped
                v.add_subview(button)                                   # set as subview of view
                
                vo = ObjCInstance(v)                                    # get ObjectiveC object of v
                # attach to each textfield an InputAccessoryView abobe the keyboard
                for sv in view.subviews:                            # loop on all subviews of main view
                    if 'TextField' in str(type(sv)):        # subview is a TextField
                        tfo = ObjCInstance(sv).textField()# get ObjectiveC object of sv
                        tfo.setInputAccessoryView_(vo)      # attach our accessory to textfield
                    
            if __name__ == '__main__':
                main_view = ui.View()
                main_view.name = 'NextFieldKeyInTextFieldKeyboard'
                main_view.frame = (0,0,380,140)
                main_view.add_subview(ui.TextField(frame=(10,  2,360,32)))
                main_view.add_subview(ui.TextField(frame=(10, 36,360,32)))
                main_view.add_subview(ui.TextField(frame=(10, 70,360,32)))
                main_view.add_subview(ui.TextField(frame=(10,104,360,32)))
                button = ui.Button()                                # Button for Next key
                button.frame = (0,0,32,32)
                button.font = ('<System-Bold>',24)
                button.title = '⏯'                                  #  emoji as title
                NextFieldKeyInTextFieldKeyboard(main_view,button)#,background_color='green')
                main_view.present('sheet')
            
            1 Reply Last reply Reply Quote 0
            • shinya.ta
              shinya.ta @cvp last edited by

              @cvp

              If possible, I would like to edit multiple Text views.

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

                @shinya.ta Just to be sure: multiple TextViews but with buttons only once?
                Button should process on TextView where the cursor is? Please confirm before I begin. Thanks

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

                  @shinya.ta Could you try/test this version and give me your feedback, thanks
                  script with multiple TextViews

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

                    @cvp

                    Dear.cvp

                    Wonderful. I was looking for this.
                    It's perfect.

                    You are God.
                    Thank you very much.
                    Thank you very much.

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

                      @shinya.ta Hello, I'm happy it's ok for you, but, believe me, I'm very far to be a god of Python, or even of anything else, like my wife says 😂

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

                        @cvp

                        Dear.cvp

                        Finally, there was one problem.
                        Even though the speech is written, they don't read the letters.

                        Is there any problem?

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

                          @cvp

                          I haven't checked the iPad yet, but the Emoji task bar doesn't show it on the iPhone.

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

                            @shinya.ta the button Next Emojis will not appear on iPad.
                            see Apple doc

                            But it should appear in the emojis rows.

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

                              @shinya.ta You were right, I had a bug for an iPhone, I'm sorry, sincerely

                              correction here

                              About the speech problem, is this one occurring since your update?

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

                                @cvp

                                The Emoji task bar was displayed on iPhone, too.
                                I didn't speak the speech on the iPhone.
                                I speak properly with iPad.

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

                                  @shinya.ta You have to check of your general settings are the same on your iPad and your iPhone

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

                                    @cvp

                                    How can I confirm that?

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

                                      @shinya.ta check one y one your settings in general/accessibility

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

                                        @cvp

                                        I checked the accessibility.
                                        But all of them were set in the same way.

                                        My wife's iPhone has a home button. There is a home button on iPad, too.
                                        But mine is iPhone XS Max, so there is no home button.

                                        Is it because of the difference in the device?

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

                                          @shinya.ta Sorry but I don't know that. Hoping somebody else in the forum could help you

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