iterm2 start breaks existing usb hid keys remapping for other apps
Bug report
- iTerm2 version: 3.4.16 and 3.5.0beta6
- OS version: 12.5.1 macos monterey
- com.googlecode.iterm2.plist
Detailed steps to reproduce the problem
- Remap keys using standard hidutil tool as documented at https://developer.apple.com/library/archive/technotes/tn2450/_index.html
I'm remapping
exec /usr/bin/hidutil property --set '{"UserKeyMapping":[
{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035},
{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},
{"HIDKeyboardModifierMappingSrc": 0x7000000E7, "HIDKeyboardModifierMappingDst": 0x7000000E6}
]}'
(last line remaps right command to right option)
- check if remapping works (in my case by pressing right command + some letter to get PL letter like ą, ę, ó etc - it works
- start iterm2 (or just create new tab)
- check again if remapping still works in non-iterm2 apps. Unfortunately no, it no longer works (in textedit, browser or macos terminal)
- Now I can run above hidutil command again and keys will be remapped correctly... until new iterm2 start or new iterm2 tab created.
What happened
When iterm2 is started existing system UserKeyMapping (like in above example) is destroyed for apps other than iterm2 (iterm2 can have own remapping in "keys" preferences).
What should have happened
Iterm own remapping should not affect existing remappings for apps other than iterm2. Or there should be possibility to prevent iterm2 interfering with right command key (and probably others).
Edited by arekm