diff options
| author | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2025-01-16 22:22:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-16 22:22:34 +0100 |
| commit | 8e7bd91f353caacc0bc4105f573eb3e17f09e03a (patch) | |
| tree | c5059edcbebd9644290cad7c653c49a36d593021 /modules/system/keyboard.nix | |
| parent | 6bd39d420578aacf7c0bab7de3e7027b952115ae (diff) | |
| parent | bd921223ba7cdac346477d7ea5204d6f4736fcc6 (diff) | |
Diffstat (limited to 'modules/system/keyboard.nix')
| -rw-r--r-- | modules/system/keyboard.nix | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/modules/system/keyboard.nix b/modules/system/keyboard.nix index 6e4275e..f4f6406 100644 --- a/modules/system/keyboard.nix +++ b/modules/system/keyboard.nix @@ -11,38 +11,44 @@ in system.keyboard.enableKeyMapping = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Whether to enable keyboard mappings."; + description = "Whether to enable keyboard mappings."; }; system.keyboard.remapCapsLockToControl = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Whether to remap the Caps Lock key to Control."; + description = "Whether to remap the Caps Lock key to Control."; }; system.keyboard.remapCapsLockToEscape = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Whether to remap the Caps Lock key to Escape."; + description = "Whether to remap the Caps Lock key to Escape."; }; system.keyboard.nonUS.remapTilde = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Whether to remap the Tilde key on non-us keyboards."; + description = "Whether to remap the Tilde key on non-us keyboards."; }; system.keyboard.swapLeftCommandAndLeftAlt = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Whether to swap the left Command key and left Alt key."; + 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); default = []; - description = lib.mdDoc '' + description = '' List of keyboard mappings to apply, for more information see <https://developer.apple.com/library/content/technotes/tn2450/_index.html>. ''; @@ -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 '' |
