Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: macro keys in fluxbox, key binding  in the minimal manager< Next Oldest | Next Newest >
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: May 23 2005,11:48 QUOTE

I was looking at replacing fluxbox with another window manager.  Not so much because there is anything wrong with fluxbox, but because I was looking for something new and different.  I was looking at keyboard binding, so I thought I'd give the keyboard binding in fluxbox a go and see what could be done.

The two things I wanted to do were:

1) Using the "Print Screen" key on my keyboard to take a snapshot of the whole screen without having to select anything

2) set up the windows keys to act something like the alt and control keys do, so that I could type <Windows> B and have a beaver application open.

The first thing I did was use a program called xev to find out if those keys were set to symbols already.  When you type a character you get all sorts of info about a key, including it's name (if any) and its numeric value.  You can see that the return key has the symble "Return" but the print screen and windows keys do not.  Take a look at the output from the following to find unbound keys you can use:

cat /usr/X11R6/lib/X11/XKeysymDB | more

I chose SunPrint_Screen for my print screen button and IA1 and IA2 for the left an right windows keys.  Next you need to make an input file for xmodmap, which will remap keys and set up the symbles for keys.  Mine was called .Xmodmap and looked like this:

Code Sample
keycode 107 = SunPrint_Screen
keycode 133 = IA1
keycode 134 = IA2
add mod5 = IA1 IA2


run xmodmap .Xmodmap (I did it from a terminal window in X).  This sets the symble for 107 to SunPrint_Screen, and sets the two windows keys to return the symble mod5.

Now the easy part is making the keybinding in fluxbox.  I added these lines to the front of my ~/.fluxbox/keys file:

Code Sample
None SunPrint_Screen :ExecCommand xwd -root > output.xwd
Mod5 b :ExecCommand beaver
Mod5 e :ExecCommand emelfm
Mod5 t :ExecCommand rxvt -rv -fn fixed -cr yellow  -T "Bash" -e /bin/bash


Choose restart from the window manager menu, and your keys are ready for use.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 24 2005,01:27 QUOTE

This should be added to the docs. :cool:

--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
Woofydugfock
Unregistered






Posted: May 25 2005,13:21 QUOTE

Thanks for this Clacker - it'll be interesting to play around with this.
Back to top
meo Offline





Group: Members
Posts: 552
Joined: April 2004
Posted: May 25 2005,17:14 QUOTE

Hello clacker!

Thanks a lot for this post clacker. Now I might be able to get my Alt Gr key to work in Firefox (perhaps). I have a swedish keyboard and it seems that all the scandinavian keyboard-layouts suffer from this problem.

Have fun,
meo


--------------
"Live and let live"   Treat others the way you want to be treated because that's what you should expect from them.

"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: May 25 2005,21:04 QUOTE

EDIT: changed it around to work and make sense

meo, perhaps you can!  I got the umlaut to work on my american keyboard, so maybe something like this will work for you.

Fist, I looked at the output of xmodmap -pke for Mode-switch which is the alt gr key.  On my keyboard, it was mapped to the right alt key.  Yours might be mapped there, somewhere else, or not at all.  Then I made the following .Xmodmap file and pressing my right alt button and u gave me a ü in rxvt but not in firefox.

Code Sample
keycode 12 = 3 numbersign threesuperior sterling
keycode 38 = a A adiaeresis Adiaeresis
keycode 30 = u U udiaeresis Udiaeresis
keycode 32 = o O odiaeresis Odiaeresis


I think what happens in Firefox is that it grabs both alt keys.  I made this .Xmodmap and now I could type a u with an umlaut in Firefox by hitting <right alt>u

Code Sample
keycode 12 = 3 numbersign threesuperior sterling
keycode 38 = a A adiaeresis Adiaeresis
keycode 30 = u U udiaeresis Udiaeresis
keycode 32 = o O odiaeresis Odiaeresis
remove Mod4 = Mode_switch
add Mod5 = Mode_switch

You might not need the lines beside the two that move the Mode_switch.

now you can umlaut till you drop.

äÄüüöÖ
Back to top
Profile PM 
6 replies since May 23 2005,11:48 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: macro keys in fluxbox

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code