keithamus/jwerty — pull request #55 by makoConstruct (2014-11-14 03:27:19+00:00)
Title: support for onRelease listener and preventing automatic key repeats

changes

new features:
events now have an onRelease listener
events do not repeat when a key is held down[the event will not fire a second time without first being released]

justifications:
features:
I need an onRelease listener
I need that onRelease listener for using key combinations for doing dragging operations and I'm pretty sure repeat fires is not expected or useful in the most user cases. Maybe there should be a config option or.. hum, maybe it should be a part of the dsl. Well we'll cross that bridge when someone cares.
event:
changed variable (event) to (ev) in method event, increases readability by removing room for confusion with the method name. Yes, of course it shadows it, but people are not very good at reassigning names as they read, we don't handle names with frequently changing meanings very well.
callback function name changed to reflect its relationship with the other callback function.
structure improved somewhat.
key:
optionality structure made it unreasonably difficult to mesh in the new variable, so I've just assumed `onRelease` is the 6th variable and removed mention of the optionality stuff from the readme.
general:
bind and unbind methods now take an optional event name[defaults to keydown]