Ubuntu – How to map a key to work like mouse button including its modifiers

accessibilityremappingxmodmap

With xmodmap I can map F2 to work as left click:

xmodmap -e "keycode 68 = Pointer_Button1"

However, when I use shift+F2 to simulate shift left-click to select files on nautilus for example, it doesn't work.

Best Answer

As nothing is defined for its modifier, when shift+F2 is pressed, nothing happens.

So:

xmodmap -e "keycode 68 = Pointer_Button1 Pointer_Button1"