How do i change the right-click-modifier key?


Klumpen

Run away! Run away!
Joined
Nov 19, 2011
Messages
8,578
Location
Uncanny Valley
I really hope, that there isn't a topic about this already, i found nothing.


Since ALT is in the middle and not easy to reach, i would like to map another key to this, the left shoulder button for right handed stylus


and the right shoulder button for lefthanded stylus would be great (i'm right handed, so it would be the left one).


It would be great, if this could be integrated in the next firmware-release.


greetings
 
Last edited by a moderator:
This is difficult for me to test, because both my shoulder buttons are broken. But if you want to remap keys in X, look at $HOME/.pndXmodmap. This file maps keys to actions (you can see that keycode 64 is Alt_L).


I don't know the keycodes for the shoulder buttons, but you can find out by installing xev from Angstrom:



Code:
sudo opkg install http://www.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a/base/xev_1.0.4-r0.5_armv7a.ipk



Run xev from the command line, press a shoulder button and that'll give you the keycode. Assuming that the left shoulder button is keycode 62 (it might not be, as I say - my shoulder buttons are broke), then you would change $HOME/.pndXmodmap to say "keycode 62 = Alt_L NoSymbol Alt_L", and then reload it with



Code:
xmodmap $HOME/.pndXmodmap



I think this is something you have to do for yourself if you want to, because if they changed the defaults in the next firmware, it would break PNDs that use the shoulder buttons (e.g. Super Geometry Dust probably matches dropping bombs with Shift_R, rather than a particular keycode.).


It probably goes without saying, but be careful when changing .pndXmodmap - trying to fix a system with a broken keymap is no fun at all.
 
Last edited by a moderator:
I forgot my Pandora at home this morning, but I know there's a setting for it but I can't remember where it is offhand. No need to poke around with xmodmap.
 
I honestly didn't know we had a right-click modifier and just tried it, but clicking while holding alt just gives me a left click. Am I missing something? Which FW release implemented that function?
 
There is a new config file in ~/Applications/Settings/libgtkstylus.conf (or more exactly $XDG_CONFIG_HOME/libgtkstylus.conf ) that has mode = 1 for the new alt = right click mode and mode = 0 for the tap-and-hold => right click (you can change between these using LCD Settings). According to the patch ( http://git.openpando...0c38b90caf4539c ) the config file can also have a line of the format "modifiers = %d" to change the modifier (the %d means that it wants a number...), but the number must be a GDK input modifier mask in numeral form (the default is whatever GDK_MOD1_MASK means to the compiler here ...). I'll figure these out and edit here.


EDIT: So I just looked at a local linux box with gtk2 installed (I think these masks dont change much), so with a small bit of uncertainty, the bits are:


// Shift is already used for moving windows


GDK_SHIFT MASK 1


// And caps lock is a bit unwieldly to use for right click


GDK_LOCK_MASK 2


// I think control might be usable but could cause problems in some things...


GDK_CONTROL_MASK 4


GDK_MOD1_MASK 8 // This is currently in the pandora (and in other places too, at least sometimes) ALT


// I cant recall what are the modifiers 2-5 in our system


GDK_MOD2_MASK 16


GDK_MOD3_MASK 32


GDK_MOD4_MASK 64


GDK_MOD5_MASK 128


// I have no idea what these are:


GDK_BUTTON1_MASK 256


GDK_BUTTON2_MASK 512


GDK_BUTTON3_MASK 1024


GDK_BUTTON4_MASK 2048


GDK_BUTTON5_MASK 4096


And in here there was a comment that "The next few modifiers are used by XKB, so we skip to the end."


"Bits 15-25 are currently unused, Bit 29 is used internally"


GDK_SUPER_MASK (1<<26) 67108864


GDK_HYPER_MASK (1<<27) 134217728


GDK_META_MASK (1<<28) 268435456


GDK_RELEASE_MASK (1<<30) // This propably is just a modifier code for key releases, dont use i think


And yeah I had to ask python what the integers are for those bigger masks :p


And I cant remember if super hyper or meta are mapped in pandora at all.


The pandora already has the left trigger mapped as shift, and it is used by default to move windows with the ts, so that propably should not be used unless you do more modding. The right trigger is Ctrl...


And yeah, the keycodes for the triggers are 62 and 105.
 
Last edited by a moderator:
Nevermind what I said about there being a setting. It's in the "LCD-Settings" menu, but it's just to turn it on or off (alt click vs the old hold click).


urjaman has the right advice.
 
Back
Top