Closed michaeltocci closed 1 year ago
[Shift] should be implemented, but the other modifier keys should not be implemented and should never be shown. You could spend a lot of time implementing crazy stuff like [ctrl]-[c], but I advise against it. An entry keyboard is not an operating system keyboard and does not need the same features. If someone has a physical keyboard, they won't see this keyboard, so you don't need these keys.
Think strictly about implementing the [shift] key as it works on other platforms and don't worry about anything else.
Regarding styling, keep it plain so people can set their own CSS without trouble.
Regarding special keys: backspace is typically provided delete is typically not provided but i'm not against it. arrow keys are not necessary. no mobile platform supplies these because they have touch. home-end are not necessary, mobile platforms have touch. tab is not necessary, touch tab-spaces... i don't think you need it but if you make gs-key allow for input of an arbitrary string and not just one letter then anyone can do stuff like this. It's possible someone may use it.
This element has been added and documented.
We keep building custom keyboards for people who are using a mobile platform with a barcode scanner. When you have a barcode scanner attached, the built-in keyboard stops appearing.
There would be two elements: the
gs-keyboard
and thegs-key
. The keyboardgs-keyboard
will listen for clicks on it's childgs-key
elements. What this does is allow us to define the structure and placing of the keys within the keyboard, but we don't have to do any javascript.The
gs-keyboard
will update thedocument.activeElement
, which is the currently focused element.gs-keyboard
is going to have to trigger key events on the element whose value it updates.Numpad example code:
A few features:
format
attribute for thegs-keyboard
, which will just be a shortcut for some standard keyboards (numpad
,qwerty
,arrows
,qwerty,arrows,numpad
).gs-key
doesn't have akey
attribute defined, we'll just use the text of the key.target
attribute on thegs-keyboard
.A few special keys:
backspace
will delete the character behind the cursor.delete
/del
will delete the character in front of the cursor.left-arrow
right-arrow
down-arrow
up-arrow
home
will move the cursor to the beginning of the line (moves to the very beginning if you're already at the start of a line).end
will move the cursor to the end of the line (moves to the very end if you're already at the end of a line).next-control
will move the focus. Usually calledtab
on your keyboard.previous-control
will move the focus. Usuallyshift
-tab
on your keyboard.tab
will add a tab character.tab-spaces
will add up to four spaces (depending on how far you're from a position that's divisible by four on the line).A few of things to figure out:
shift
,control
,option
andcommand
keys?