mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-15 17:51:01 +00:00
Merge pull request #1023 from malko42/swap-ctrl-fn
(feature) Add swapLeftCtrlAndFn
This commit is contained in:
commit
91010a5613
2 changed files with 17 additions and 0 deletions
|
@ -38,6 +38,12 @@ in
|
|||
description = "Whether to swap the left Command key and left Alt key.";
|
||||
};
|
||||
|
||||
system.keyboard.swapLeftCtrlAndFn = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to swap the left Control key and Fn (Globe) key.";
|
||||
};
|
||||
|
||||
system.keyboard.userKeyMapping = mkOption {
|
||||
internal = true;
|
||||
type = types.listOf (types.attrsOf types.int);
|
||||
|
@ -66,6 +72,14 @@ in
|
|||
HIDKeyboardModifierMappingSrc = 30064771298;
|
||||
HIDKeyboardModifierMappingDst = 30064771299;
|
||||
})
|
||||
(mkIf cfg.swapLeftCtrlAndFn {
|
||||
HIDKeyboardModifierMappingSrc = 30064771296;
|
||||
HIDKeyboardModifierMappingDst = 1095216660483;
|
||||
})
|
||||
(mkIf cfg.swapLeftCtrlAndFn {
|
||||
HIDKeyboardModifierMappingSrc = 1095216660483;
|
||||
HIDKeyboardModifierMappingDst = 30064771296;
|
||||
})
|
||||
];
|
||||
|
||||
system.activationScripts.keyboard.text = optionalString cfg.enableKeyMapping ''
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
system.keyboard.remapCapsLockToEscape = true;
|
||||
system.keyboard.nonUS.remapTilde = true;
|
||||
system.keyboard.swapLeftCommandAndLeftAlt = true;
|
||||
system.keyboard.swapLeftCtrlAndFn = true;
|
||||
|
||||
test = ''
|
||||
echo checking keyboard mappings in /activate >&2
|
||||
|
@ -17,5 +18,7 @@
|
|||
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771298" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771299" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":1095216660483" ${config.out}/activate
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue