Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map modifier to mouse button click #132

Closed
planet36 opened this issue May 25, 2021 · 1 comment
Closed

map modifier to mouse button click #132

planet36 opened this issue May 25, 2021 · 1 comment

Comments

@planet36
Copy link

I want to map a momentary press of the Shift key to a mouse left click (or double click).

Is this possible with xcape?

In /usr/include/X11/keysymdef.h I found these definitions:

#define XK_Pointer_Button_Dflt           0xfee8
#define XK_Pointer_Button1               0xfee9
#define XK_Pointer_DblClick_Dflt         0xfeee
#define XK_Pointer_DblClick1             0xfeef

Trying to use any of those results in an error.

$ xcape -d -t 500 -e 'Shift_L=Pointer_Button_Dflt'

Assigned mapping from "Shift_L" ( keysym 0xffe1, key code 50)
WARNING: No keycode found for keysym Pointer_Button_Dflt (0xfee8) in mapping Shift_L. Ignoring this mapping.
Failed to parse_mapping

$ xcape -d -t 500 -e 'Shift_L=Pointer_Button1'

Assigned mapping from "Shift_L" ( keysym 0xffe1, key code 50)
WARNING: No keycode found for keysym Pointer_Button1 (0xfee9) in mapping Shift_L. Ignoring this mapping.
Failed to parse_mapping

$ xcape -d -t 500 -e 'Shift_L=Pointer_DblClick_Dflt'

Assigned mapping from "Shift_L" ( keysym 0xffe1, key code 50)
WARNING: No keycode found for keysym Pointer_DblClick_Dflt (0xfeee) in mapping Shift_L. Ignoring this mapping.
Failed to parse_mapping

$ xcape -d -t 500 -e 'Shift_L=Pointer_DblClick1'

Assigned mapping from "Shift_L" ( keysym 0xffe1, key code 50)
WARNING: No keycode found for keysym Pointer_DblClick1 (0xfeef) in mapping Shift_L. Ignoring this mapping.
Failed to parse_mapping

@planet36
Copy link
Author

I found a solution using xmodmap, xcape, sxhkd, and xte.

(in .xinitrc)

# Look for unused KeyCodes
#xmodmap -pk

# Map F13 to an unused KeyCode
xmodmap -e 'keycode 253 = F13'

xcape -e 'Shift_L=F13'

(in .config/sxhkd/sxhkdrc)

@F13
	xte 'mouseclick 1' 'mouseclick 1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant