Web Component: j-Movement
j-Movement
This component captures basic keyboard keys like arrows
, enter
and esc
.
- jComponent
v19|v20
Methods:
component.assign(ondown(key, e), [onunassign])
The assign
method will clear previous assignments and applies new ones. We recommend calling the assign
method to your elements when they are focused, or the user clicks on them.
Usage:
SETTER('movement/assign', function(key, e) {
// @key {String}
// @ {Event}
switch (key) {
case 'up':
case 'down':
case 'right':
case 'left':
case 'esc':
case 'enter':
break;
}
});
Author
- Peter Širka petersirka@gmail.com
- License
Created
19. july 2021
Updated
31. january 2023
jComponent library
19 | 20
Version
v1
License
https://www.totaljs.com/license/
Responsive
Yes
Author
Peter Širka
Email
petersirka@gmail.com