Skip to content

mofron/mofron-event-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mofron-event-key

mofron is module based frontend framework.

key event for mofron

event function parameter

  • component: event target component object

  • string: event target key

  • mixed: user specified parameter

Feature

  • it is possible to implement key-event to target component by setting type that is "keydown", "keypress" or "keyup" (default type is "keydown")
  • it is possible to filter the target event key by setting the 'key' method.
  • the target key is all if user not set 'key' method.

Attention

  • set event to mofron.window or mofron.document if you apply key-event to the whole page.

Install

npm install mofron mofron-event-key

Sample

<setting>
    <tag load="mofron-comp-input">Input</tag>
    <tag load="mofron-event-key">Key</tag>
</setting>

<script name=key run=init>
    console.log("'" + key2 + "' key press");
</script>

<Input name=inp event=Key:@key></Input>

Parameter

Short
Form
Parameter Name Type Description
listener function event function
mixed event parameter
key string event target key

Releases

No releases published

Packages

No packages published