UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    xev like tool to see key_press (...) events

    Scheduled Pinned Locked Moved Support
    6 Posts 3 Posters 393 Views 2 Watching
    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.
      • G Offline
        guru
        last edited by

        When I connect a BT keyboard to my BQ E4.5 or M10 I can key-in a lot of more keystrokes than by the OSC, for example combinations of Alt + a which get just ignored at the moment by the terminal app.

        In plain old X11 there is a tool xev to read and understand what the Xserver gets as key-pressed, key-release etc. events and one can map these with another command xmodmap to characters the application receives.

        How I could do this within UT? Is there some app to read native from the keyboard? Or some undocumented logging?

        matthias

        1 Reply Last reply Reply Quote 0
        • dobeyD Offline
          dobey
          last edited by

          You should be able to install xev inside libertine and run it from there.

          1 Reply Last reply Reply Quote 0
          • alan_gA Offline
            alan_g
            last edited by

            @guru said in xev like tool to see key_press (...) events:

            In plain old X11 there is a tool xev to read and understand what the Xserver gets as key-pressed, key-release etc. events and one can map these with another command xmodmap to characters the application receives.
            How I could do this within UT? Is there some app to read native from the keyboard? Or some undocumented logging?

            Mir (and therefore Unity8) takes the view that applications should not be able to "spy" on the input to other applications. So, in UT applications don't have access to input devices and only get key events that Unity8 routes to them.

            As you may suspect, there's a special dispensation for the OSK to synthesise keyboard events and pass them (via Unity8) to the app. I don't know enough about how that works to know if it could help your scenario.

            1 Reply Last reply Reply Quote 0
            • G Offline
              guru
              last edited by

              Thanks for answering, Alan. Is the OSK used to route the chars to the terminal-app when the key-events (and mouse events) come from a Bluetooth device? At least the OSK is not visible in this case on the screen.

              Where I could check the sources for the OSK? Thanks

              alan_gA 1 Reply Last reply Reply Quote 0
              • alan_gA Offline
                alan_g @guru
                last edited by

                @guru said in xev like tool to see key_press (...) events:

                Is the OSK used to route the chars to the terminal-app when the key-events (and mouse events) come from a Bluetooth device?

                No.

                At least the OSK is not visible in this case on the screen.

                Exactly.

                Where I could check the sources for the OSK?

                They'll be on github or gitlab (UBports are migrating projects from one to the other).

                I suspect you are misunderstanding me: OSK is not the solution you asked for, but it is the only process that does anything even vaguely like what you want. So, if you figure out how it is able to do that, you might be able to use that knowledge to create something new to remap input.

                I suggest that writing a new terminal app (or enhancing the existing one) with the ability to remap input would be far simpler.

                G 1 Reply Last reply Reply Quote 0
                • G Offline
                  guru @alan_g
                  last edited by

                  @alan_g said in xev like tool to see key_press (...) events:

                  They'll be on github or gitlab (UBports are migrating projects from one to the other).
                  I suspect you are misunderstanding me: OSK is not the solution you asked for, but it is the only process that does anything even vaguely like what you want. So, if you figure out how it is able to do that, you might be able to use that knowledge to create something new to remap input.

                  No, I didn't misunderstood you. I wanted to look into OSK to see which key-events are arriving there and what is assembled of them to route it to the apps.

                  I suggest that writing a new terminal app (or enhancing the existing one) with the ability to remap input would be far simpler.

                  Focus on the terminal-app could be done only when the events are arriving in it on a low level. In addition would mean that any other app could not be see the key-events which are possible with a BT keyboard. In the past I expanded already the mapping for the terminal app with json files like:

                  {
                      "name" : "mutt Keys",
                      "short_name" : "mutt",
                  
                      "buttons": [
                          {
                              "main_action" : {
                                  "type": "key",
                                  "text" : "ESC",
                                  "key" : "Escape"
                              }
                          },
                  ...
                  

                  Maybe a first step would be add some logging in the terminal-app to understand what chars are arriving there from a BT keyboard (not only from the OSK).

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post