From b259ff5a42289b6dd98101fd2805bfcaba742a9c Mon Sep 17 00:00:00 2001 From: Steffen Rademacker Date: Sat, 17 Jun 2017 13:52:33 +0200 Subject: [PATCH] Fix fn keys, using hyper + number --- hammerspoon/init.lua | 19 ++++++++++++++++--- karabiner/karabiner.json | 8 ++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/hammerspoon/init.lua b/hammerspoon/init.lua index f2f3f6b4..3534c35e 100644 --- a/hammerspoon/init.lua +++ b/hammerspoon/init.lua @@ -6,6 +6,7 @@ local hyper = { 'cmd', 'alt', 'shift', 'ctrl' } -------------------- hs.window.animationDuration = 0 +tiling.set('layouts', { 'fullscreen', 'gp-vertical', 'gp-horizontal', 'columns' }) function isInScreen(screen, win) return win:screen() == screen @@ -38,8 +39,6 @@ local function center(window) window:setFrame(frame) end -hs.hotkey.bind(hyper, '1', function() tiling.goToLayout('gp-vertical'); moveMouse() end) -hs.hotkey.bind(hyper, '2', function() tiling.goToLayout('fullscreen'); moveMouse() end) hs.hotkey.bind(hyper, 'f', function() tiling.toggleFloat(center); moveMouse() end) hs.hotkey.bind(hyper, 'r', function() tiling.retile(); moveMouse() end) hs.hotkey.bind(hyper, 'a', function() tiling.cycle(1); moveMouse() end) @@ -53,4 +52,18 @@ hs.hotkey.bind(hyper, 'k', function() hs.window.focusedWindow():focusWindowNorth hs.hotkey.bind(hyper, 'l', function() hs.window.focusedWindow():focusWindowEast(); moveMouse() end) hs.hotkey.bind(hyper, 'n', function () focusScreen(hs.window.focusedWindow():screen():next()) end) -tiling.set('layouts', { 'fullscreen', 'gp-vertical', 'gp-horizontal', 'columns' }) +-- map hyper + number to the corresponding fn-key, since the touchbar +-- kinda sucks, and karabiner-elements is breaking fn-function to show keys +hs.hotkey.bind(hyper, '1', function() hs.eventtap.keyStroke({}, 'F1') end) +hs.hotkey.bind(hyper, '2', function() hs.eventtap.keyStroke({}, 'F2') end) +hs.hotkey.bind(hyper, '3', function() hs.eventtap.keyStroke({}, 'F3') end) +hs.hotkey.bind(hyper, '4', function() hs.eventtap.keyStroke({}, 'F4') end) +hs.hotkey.bind(hyper, '5', function() hs.eventtap.keyStroke({}, 'F5') end) +hs.hotkey.bind(hyper, '6', function() hs.eventtap.keyStroke({}, 'F6') end) +hs.hotkey.bind(hyper, '7', function() hs.eventtap.keyStroke({}, 'F7') end) +hs.hotkey.bind(hyper, '8', function() hs.eventtap.keyStroke({}, 'F8') end) +hs.hotkey.bind(hyper, '9', function() hs.eventtap.keyStroke({}, 'F9') end) +hs.hotkey.bind(hyper, '0', function() hs.eventtap.keyStroke({}, 'F10') end) +hs.hotkey.bind(hyper, '-', function() hs.eventtap.keyStroke({}, 'F11') end) +hs.hotkey.bind(hyper, '=', function() hs.eventtap.keyStroke({}, 'F12') end) + diff --git a/karabiner/karabiner.json b/karabiner/karabiner.json index 2c020712..e57fe74b 100644 --- a/karabiner/karabiner.json +++ b/karabiner/karabiner.json @@ -66,14 +66,14 @@ }, "devices": [ { - "disable_built_in_keyboard_if_exists": true, + "disable_built_in_keyboard_if_exists": false, "identifiers": { "is_keyboard": true, "is_pointing_device": false, - "product_id": 256, - "vendor_id": 2131 + "product_id": 34304, + "vendor_id": 1452 }, - "ignore": false + "ignore": true } ], "fn_function_keys": {