Webanizr Logo
Open / sluit menu
Module keys

Last change: December 6, 2019

Current version: 1..0.0

The keys module binds key shortcuts on a website to callback functions

syntax

webanizr.collect('keys', params, callback);

parameters

The keys module accepts the following parameters:

key__binding (required)

The key you want to bind. For instance "e" to bind a function to the pressing of the key "e". NOTE: "e" and "E" both mean "e". If you want to catch "E" you can add "e" and activate the shift key (pressed__shift).

pressed__shift (optional)

Call the callback function if the key is pressed while the shift key was pressed.

pressed__alt (optional)

Call the callback function if the key is pressed while the alt key was pressed.

pressed__ctrl (optional)

Call the callback function if the key is pressed while the control key was pressed.

callback

The callback to call when the key(s) are pressed

demo

https://cdn.cpmodules.webanizr.com/demo/key-bindings/index.html

changelog

  • December 6, 2019: 1.0.0 - The initial version