I’m perfectly willing to assume that I’m doing something bone-headed, here, but I can’t figure what.
The Keybow’s working fine, but my attempt at creating my own layout isn’t going so well. I’ve set up keys for F11, F12, and the cursor arrows, and that’s all working a treat.
The first thing that isn’t working is this:
function handle_key_02(pressed)
keybow.set_key(keybow.RIGHT_ALT, pressed)
end
Now, I was expecting that to act as an Alt. Gr. key - which my main keyboard lacks - but what it actually does is type the letter c. Just c. Nothing else. If I hold it down, it repeats the letter c. At no point does it act like an Alt. modifier, Gr. or otherwise.
The next problem I’m having: symbol handling.
function handle_key_08(pressed)
keybow.set_key("°", pressed)
end
I figured that would give me a degree symbol, but it doesn’t: nothing happens. Fair enough, a degree symbol isn’t a single key on a keyboard, so let’s enter it as text:
function handle_key_06(pressed)
keybow.text("°", pressed)
end
No change: pressing the key still doesn’t do anything. So, wait, the examples in the documentation don’t have “pressed” on the end…
function handle_key_06(pressed)
keybow.text("°")
end
Still nothing. Okay, let’s give up on that - and the bindings I attempted for € and ¥ - and try a text snippet.
function handle_key_11(pressed)
keybow.text("Please find attached my invoice for work carried out on ", pressed)
end
That kinda-sorta works, except it occasionally drops a character or two - never the same character - and it prints it once on key-down and once on key-up. So, let’s try removing the “pressed” again:
function handle_key_11(pressed)
keybow.text("Please find attached my invoice for work carried out on ")
end
No change. Neither is there if I put not pressed
at the end instead. It always prints twice, once on key-down and once on key-up.
Any assistance is much appreciated - as I say, I’m perfectly willing to assume it’s me being boneheaded, but I can’t figure out how to get these working!
Full Lua file below:
require "keybow"
-- Extensions for the IBM Model F's missing keys. --
-- Key mappings --
function handle_key_00(pressed)
keybow.set_key(keybow.F11, pressed)
end
function handle_key_01(pressed)
keybow.set_key(keybow.F12, pressed)
end
function handle_key_02(pressed)
keybow.set_key(keybow.RIGHT_ALT, pressed)
end
function handle_key_03(pressed)
keybow.set_key(keybow.LEFT_ARROW, pressed)
end
function handle_key_04(pressed)
keybow.set_key(keybow.DOWN_ARROW, pressed)
end
function handle_key_05(pressed)
keybow.set_key(keybow.RIGHT_ARROW, pressed)
end
function handle_key_06(pressed)
keybow.text("°")
end
function handle_key_07(pressed)
keybow.set_key(keybow.UP_ARROW, pressed)
end
function handle_key_08(pressed)
keybow.set_key("^", pressed)
end
function handle_key_09(pressed)
keybow.text("€")
end
function handle_key_10(pressed)
keybow.text("¥")
end
function handle_key_11(pressed)
keybow.text("Please find attached my invoice for work carried out on ", not pressed)
end
```