You are not logged in.

#1 2013-02-14 00:25:37

nagaseiori
Member
Registered: 2012-09-22
Posts: 72

Map mouse buttons to keystrokes

I would like to map mouse buttons 6 and 7 to the keystrokes Alt-Minus and Alt-Equals in order to use them with dwm. I have tried to use btnx, but it failed to compile because of the following error:

...
gcc -Wall -O2 `pkg-config --cflags gtk+-2.0 libglade-2.0` -I../intl -I../intl -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 `pkg-config --libs gtk+-2.0 libglade-2.0` -Wl -export-dynamic -DPREFIX=/usr/share/btnx-config -Wl,-O1,--sort-common,--as-needed,-z,relro -o btnx-config btnx_config.o widgets.o callbacks_config.o callbacks_moused.o timers.o moused.o ip_pipe.o handlers.o btnd.o rawcodes.o callbacks_btnd.o buttons.o threads.o config.o tree_buttons.o keycodes.o config_file.o mouse.o dialog_btnd.o keycodes_entry.o udev.o help.o revoco.o config_manager.o tree_config.o backup.o status_bar.o  
gcc: error: unrecognized command line option ?-Wl?

I was thinking I could do something with xmodmap, but apparently it only supports keyboard mapping.

Offline

#2 2013-02-14 00:33:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Map mouse buttons to keystrokes

What are ALT - = supposed to do?  They do not have default bindings?  Why man a mouse click to a key binding, why not just use dwm's mouse binding capabilities to bind the mouse clicks to what you want them to do?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2013-02-14 02:34:04

nagaseiori
Member
Registered: 2012-09-22
Posts: 72

Re: Map mouse buttons to keystrokes

How would I bind mouse buttons for dwm? I had the impression that I could only use the keyboard. ALT - = are two things I added to cycle through workspaces. I want horizontal scrolling to have that same effect.

Offline

#4 2013-02-14 02:38:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Map mouse buttons to keystrokes

The mouse bindings are directly below the key bindings in config.h


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2013-02-14 02:47:44

nagaseiori
Member
Registered: 2012-09-22
Posts: 72

Re: Map mouse buttons to keystrokes

It won't compile if I put Button6 or Button7 in for the mouse button.

Offline

#6 2013-02-14 03:33:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Map mouse buttons to keystrokes

ButtonN are just constants defined to the number - just use the number.  X.h only defines 1-5, but 6 and 7 work fine too.

Last edited by Trilby (2013-02-14 03:36:32)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB