Giter VIP home page Giter VIP logo

Comments (3)

SerVB avatar SerVB commented on July 20, 2024 1

Has someone come up with the right and universal way to input numpad digits via xdotool?

For example, I want to input Numpad-5. I do xdotool key KP_5 but I get the following in xev (shift is activated too and I don't have "5" input in my app):

KeyPress event, serial 39, synthetic NO, window 0x7a00001,
    root 0x258, subw 0x0, time 5567089, (1421,438), root:(1461,491),
    state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7a00001,
    root 0x258, subw 0x0, time 5567119, (1421,438), root:(1461,491),
    state 0x11, keycode 84 (keysym 0xff9d, KP_Begin), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7a00001,
    root 0x258, subw 0x0, time 5567126, (1421,438), root:(1461,491),
    state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7a00001,
    root 0x258, subw 0x0, time 5567126, (1421,438), root:(1461,491),
    state 0x10, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
    XLookupString gives 1 bytes: (35) "5"
    XFilterEvent returns: False

The current way I use is xdotool key 84 – it gives me correct results but I'm not sure that 84 is KP_5 for every Linux machine:

KeyPress event, serial 38, synthetic NO, window 0x7400001,
    root 0x258, subw 0x0, time 6201400, (984,-4), root:(2795,992),
    state 0x10, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
    XLookupString gives 1 bytes: (35) "5"
    XmbLookupString gives 1 bytes: (35) "5"
    XFilterEvent returns: False

KeyRelease event, serial 39, synthetic NO, window 0x7400001,
    root 0x258, subw 0x0, time 6201423, (984,-4), root:(2795,992),
    state 0x10, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
    XLookupString gives 1 bytes: (35) "5"
    XFilterEvent returns: False

key KP_Begin also works but again I'm not sure it will be available on other machines. Is there maybe a way to switch machine layout to something universal prior running xdotool, maybe it will help?

from xdotool.

AlisterH avatar AlisterH commented on July 20, 2024

I think this problem was previously noticed at:
https://groups.google.com/forum/#!msg/xdotool-users/NOroPeUUuqs/b-2sWNdq2P0J

from xdotool.

C0rn3j avatar C0rn3j commented on July 20, 2024

Still a problem.

Workaround as per the linked forum - Use the alternative names, not the numbered ones.
You can get them from xmodmap -pke

Tested on Arch xdotool 3.20160805.1-3

xev output:

xdotool key KP_5
image

xdotool key KP_Begin
image

from xdotool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.