You are not logged in.
I'd like to change my modMask in xmonad if I'm on a mac, but otherwise leave it alone. I'm confused about two different aspects of this. Can I tell the difference between a qwerty on a mac vs non-mac keyboards? And is there a way to get the default value for modMask or conditionally set it (instead of just looking up the default and hardcoding it)? I'm not sure how this would work if I had an external keyboard hooked up to my mac, but it'd be cool to at least get it working for the normal cases. Thanks for any help ![]()
Offline
To answer the questions directly:
1) The only means I know of is using the USB product and vendor IDs. The layout and variant is not published by the keyboard.
2) It's haskell. But this may not be necessary:
Perhaps instead of making the modMask dynamic, you could use xmodmap to change the key membership of the corresponding modifier? And udev should be able to handle the keyboard detection.
I have 2 xmodmap config files (one for each state), which are triggered by a udev script like:
/etc/udev/rules.d/90-kbd.rules:
SUBSYSTEM=="usb", ATTRS{idVendor}=="<USB vendor ID>", ATTRS{idProduct}=="<USB product ID>", ENV{REMOVE_CMD}="<command to set state on removal>", RUN+="<command to set state on device connection>"And so you can use this to set a default layout (REMOVE_CMD), and alter it when a certain device is attached (RUN).
You will probably need to use xhost to loosen security on the X11 session so xmodmap can make the changes when initiated via udev.
Offline
... The only means I know of is using the USB product and vendor IDs. The layout and variant is not published by the keyboard.
...
One might also look at the contents of /proc/bus/input/devices
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Hmm, thanks for the info. I've tried a couple of different keyboards, and actually started learning emacs, so now I would prefer to always use super as my mod key, so I can have alt for readline/emacs. Cheers ![]()
end
Offline