SkayaWiki

X11TipsAndTricks

JeromePetazzoni :: DerniersChangements :: DerniersCommentaires? :: ParametresUtilisateur :: http://www.enix.org/ :: Vous êtes ec2-18-119-163-95.us-east-2.compute.amazonaws.com
First, a couple of tricks to setup a locked-down browser (for kiosk applications, for instance).

To disable the middle and right buttons of your mouse (actually, it will remap buttons 2 and 3 to buttons 20 and 30, which are usually inactive) :
xmodmap -e "pointer = $(xmodmap -pp | awk '{print $1}' | grep '^[0-9]' | tr '\n' ' ' | sed 's/ 2 3 / 20 30 /')"

To restore normal mouse buttons : xmodmap -e "pointer = default"

To disable ctrl, alt, numlock and other modifiers (this will only leave shift and capslock active ; if you wand to keep numlock, remove mod2 from the list) :
(Note that you can still use applications like numlockx to change numlock state)

for MODE in control mod1 mod2 mod3 mod4 mod5
do xmodmap -e "clear $MODE"
done

To disable all function keys :

for KEYSYM in F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
do xmodmap -e "keysym $KEYSYM = "
done

To restore modifiers and function keys with a single command, just do setxkbmap us (replace us with the mapping you use).

Now, if you want to disable some keyboard shortcuts or mouse combinations, you can use xbkindkeys. If you define a xbindkeys macro to do nothing (for instance, start /bin/true) and assign it to Shift+Click, then Shift+Click will never reach firefox (or other applications). You can also use sawfish. I recommend using sawfish, since it is an excellent window manager, allowing a very high level of customization ; using sawfish-ui, you can very easily configure all your mplayer windows to be borderless, or your thunderbird windows to show up on such or such virtual workspace... I did not find yet any other WM allowing me to do everything I wanted to do.

Those ugly hacks are the only way I found so far to disable shift+click in Firefox (shift+click will open the pointed link in a new window, thus allowing users to « evade » the website you tried to lock them in).
Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]