You are not logged in.

#1 2022-02-19 10:56:29

John Path
Member
Registered: 2021-10-15
Posts: 57

Arch detecting one key as another from keyboard.

Hi friends,

My laptop is detecting a function key which is that use to project my screen on another monitor on windows (on F7 key) as Super_L.

I want to launch a script to extend the monitor when fn+F7 is pressed but it is also starting while i am pressing the actual Left Super Key.

This is the output of showkey while pressing and releasing fn+F7

keycode 125 press
keycode  25 press
keycode  25 release
keycode 125 release

This is the output of showkey while pressing and releasing the actual left super key

keycode 125 press
keycode 125 release

Output of xev -event keyboard while pressing fn+F7

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0x963, subw 0x0, time 4063580, (226,391), root:(1232,433),
    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  99  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           32  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0x963, subw 0x0, time 4063677, (226,391), root:(1232,433),
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Output of xev -event keyboard while pressing actual left super key

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0x963, subw 0x0, time 4089551, (335,311), root:(1341,353),
    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0x963, subw 0x0, time 4089662, (335,311), root:(1341,353),
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0x963, subw 0x0, time 4095639, (401,416), root:(1407,458),
    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

All help is appreciated.

Offline

#2 2022-02-19 13:03:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,837

Re: Arch detecting one key as another from keyboard.

Fn+7 fires Super_L+P (because that's the windows projection shortcut) and that's bound to something already (the keymap notify event indiactes that)
You're not gonna be able to reasonably change anything about that behavior, but it's not clear to me what your actual goal is here ("but it is also starting while i am pressing the actual Left Super Key")

Online

#3 2022-02-22 06:46:30

John Path
Member
Registered: 2021-10-15
Posts: 57

Re: Arch detecting one key as another from keyboard.

seth wrote:

but it's not clear to me what your actual goal is here ("but it is also starting while i am pressing the actual Left Super Key")

I want to launch a script while pressing fn+F7 with sxhkd

Super_L
  ./project.sh

It works while i press fn+F7 but when i press the actual Left Super key (super key near to fn key)
it also runs the script.

So, i want to run script when window project key is pressed but not when super key is pressed

Offline

#4 2022-02-22 07:46:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,837

Re: Arch detecting one key as another from keyboard.

So bind the script to "Super_L + P"?

Online

#5 2022-03-05 12:23:32

John Path
Member
Registered: 2021-10-15
Posts: 57

Re: Arch detecting one key as another from keyboard.

Binding script with "Super_L + P" is not working

Offline

#6 2022-03-05 13:51:20

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,837

Re: Arch detecting one key as another from keyboard.

"does not work" isn't a problem description.
https://bbs.archlinux.org/viewtopic.php?id=57855

Do you fail to bind the shortcut to anything, do you successfully bind it to the script but the script doesn't work or are there other problems?
The xev output tells me that it currently is bound to *something*.

Edit: or does binding Super_L+P actually work and triggers the desired action, but the hotkey does not yield the same behavior?

Last edited by seth (2022-03-05 14:13:11)

Online

Board footer

Powered by FluxBB