unifiedremote / Docs

Official API documentation.
149 stars 33 forks source link

grave not working on custom remote #18

Open momar33 opened 5 years ago

momar33 commented 5 years ago

I am making a custom remote that requires the grave key (the other character on the tilde key).

I set it to grave as found on the available keys list, but it does not work.

Here is my remote.lua code: `local kb = libs.keyboard;

-- Documentation -- http://www.unifiedremote.com/api

-- Keyboard Library -- http://www.unifiedremote.com/api/libs/keyboard

--@help Full Screen actions.fullScreen = function () kb.stroke("f"); end

--@help Pause actions.pause = function () kb.stroke("space"); end

--@help Switch Screens actions.switchSCreens = function () kb.stroke("grave"); end`

momar33 commented 5 years ago

So I apparently looked in the wrong section for the keys. Windows does not have a grave.

How can I set a button up to use a tilde, also how can I set a button up to use the backtick?

groovenectar commented 5 years ago

Wow, I had always called it a backtick. TIL. I have a windows keyboard though, and it's on there?

Sorry for the shot in the dark, but does this not do it? kb.stroke("`");

momar33 commented 5 years ago

kb.stroke("`"); does not work.

ghost commented 4 years ago

for the "tilde" or "backtick", (which.is "grave accent") instead of using kb.stroke

Instead, use the function kb.character

The kb.character uses the "character.keyboard" library found in unified remote, which uses UTF-8 hex coding (refer to the link at the bottom for details), but the coding is 0x60

So instead of kb.stroke("'");

our output will be kb.character(0x60);

Full string would look like the following:

actions.command1 = function () kb.character(0x60); end


Link Ref: keyboard.character( chr ) Reference https://github.com/unifiedremote/Docs/blob/master/libs/keyboard.md Unicode Reference (includes UTF-8 hex) https://www.fileformat.info/info/unicode/char/0060/index.htm