jasonrudolph / keyboard

⌨ Toward a more useful keyboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyper issues on German keyboards with @-sign

chbroecker opened this issue · comments

Hey Jason,

thank you for this awesome repo but I have a small problem with the 'Hyper' key.
On the German Keyboard the 'right option' + lowercase 'L' writes the @-sign.
Is it possible to remap that to 'Hyper' + lowercase 'L' ?
I looked at the 'hyper.lua' file and it looks like I can only open apps or execute functions. I am not familiar with Lua so I was wondering what I would have to do to just send one symbol.

Best,
Chris

On the German Keyboard the 'right option' + lowercase 'L' writes the @-sign.
Is it possible to remap that to 'Hyper' + lowercase 'L' ?

👋 Hi @chbroecker: Thanks for trying out this repo! I'll try to help.

If you make a copy of hyper-apps-defaults.lua and name it hyper-apps.lua, you can customize Hyper Mode to your liking. Then, if you make the changes shown below, you can remap hyper+l to type a lowercase l. Does that help?

--- a/hammerspoon/hyper-apps.lua
+++ b/hammerspoon/hyper-apps.lua
@@ -3,6 +3,11 @@
 -- To launch _your_ most commonly-used apps via Hyper Mode, create a copy of
 -- this file, save it as `hyper-apps.lua`, and edit the table below to configure
 -- your preferred shortcuts.
+
+function exampleFunction()
+  hs.eventtap.keyStrokes('l')
+end
+
 return {
   { 'a', 'iTunes' },            -- "A" for "Apple Music"
   { 'b', 'Google Chrome' },     -- "B" for "Browser"
@@ -11,6 +16,7 @@ return {
   { 'e', 'Atom' },              -- "E" for "Editor"
   { 'f', 'Finder' },            -- "F" for "Finder"
   { 'g', 'Mailplane 3' },       -- "G" for "Gmail"
+  { 'l', exampleFunction },
   { 's', 'Slack' },             -- "S" for "Slack"
   { 't', 'iTerm' },             -- "T" for "Terminal"
 }

Note: You'll need to reload your Hammerspoon config each time you change the code.

Thanks for the reply!

Yes that was exactly what I was trying to do:
Pressing Hyper + l now just types an @ which it did before installing your awesome keyboard extension.

function giveMeAt()
  hs.eventtap.keyStrokes('@')
end

I also read through the Modern Space Cadet Blogpost and was wondering if you did something similar to the part about "Shift Key Training Wheels". Forcing someone to use the correct shift key. I always find myself mostly using the left shift.
He is using KeyRemap4MacBook but would this also be possible with Karabiner-elements?

If you haven't looked into it it's all good. But I was just wondering because you seem to have taken a lot of inspiration form his post :)

Yes that was exactly what I was trying to do:

Great! With that in mind, I'll close this issue.

I also read through the Modern Space Cadet Blogpost and was wondering if you did something similar to the part about "Shift Key Training Wheels". Forcing someone to use the correct shift key. I always find myself mostly using the left shift. He is using KeyRemap4MacBook but would this also be possible with Karabiner-elements?

I haven't tried the "Shift Key Training Wheels", but I suspect you could implement it with Karabiner-Elements.

Okay thanks again for helping and I will look into it :)