awesomeWM/awesome

root.fake_input({}, " ") or root.fake_input({}, "space") doesn't work

Opened this issue · 4 comments

Elv13 commented

Well, this isn't new at all, it never worked for as long as I remember (I got a macro module, and space never printed).

However, I am trying to emulate all awesomerc keybindings in an integration tests and this is a problem.

root.fake_input("key_press", "Super_L")
root.fake_input("key_press"  , " ") -- or "space", or "#65"
root.fake_input("key_release", " ") -- or "space"
root.fake_input("key_release", "Super_L")

Works for me:

  • root.fake_input("key_press", 65) root.fake_input("key_release", 65)
  • root.fake_input("key_press", "space") root.fake_input("key_release", "space")

In both cases, xev reports that space was pressed.

Also, the following toggles xev's floating state for me:

  • root.fake_input("key_press", "Super_L") local k = "space" root.fake_input("key_press", k) root.fake_input("key_release", k) root.fake_input("key_release", "Super_L")

What am I doing wrong (or right)?

Elv13 commented

Umm, strange, it doesn't for me (with unit test...) and my macro module also doesn't print spaces.

What does xev report when you do the above? What does xev report when you fake the "does-not-exist" key (in my case, I get keycode 8 (keysym 0x0, NoSymbol))?
Since I have no idea what else could influence this:

$ setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwertz)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+de+inet(evdev)+capslock(backspace)+terminate(ctrl_alt_bksp)"    };
    xkb_geometry  { include "pc(pc105)" };
};
Elv13 commented

I just recorded a macro dddd bbbb (4 spaces in the middle, markdown hide them)

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163431911, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XmbLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163431911, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163432117, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XmbLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163432119, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163432307, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XmbLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163432308, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163432491, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XmbLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163432492, (264,101), root:(1532,551),
    state 0x0, keycode 40 (keysym 0x64, d), same_screen YES,
    XLookupString gives 1 bytes: (64) "d"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433216, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433220, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433383, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433384, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433567, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433568, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433735, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163433736, (264,101), root:(1532,551),
    state 0x0, keycode 8 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434241, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XmbLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434242, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434404, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XmbLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434406, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434580, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XmbLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434582, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyPress event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434757, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
    XmbLookupString gives 1 bytes: (62) "b"
    XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x5a00001,
    root 0xd7, subw 0x0, time 163434758, (264,101), root:(1532,551),
    state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
    XLookupString gives 1 bytes: (62) "b"
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+inet(evdev)" };
    xkb_geometry  { include "pc(pc105)" };
};