Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9592 (closed enhancement: duplicate)

Opened 1 year ago

Last modified 5 months ago

keyCode handling functions

Reported by: alexsiri7 Assigned to: sam
Priority: normal Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords: keyCode
Cc:

Description

Some functions to add to Event, to handle keyCodes:

//Obtain the keyCode keyCode:function(event){

return event.which event.keyCode;

}, //Compare keyCode hasKeyCode:function(event,keycode){

return Event.keyCode(event)==keycode;

}, //Compare Keycode with char, case insensitive hasKeyChar:function(event,keychar){

return String.fromCharCode(Event.keyCode(event)).toLowerCase ==keychar.toLowerCase ;

},

Change History

04/03/08 01:28:29 changed by jdalton

  • status changed from new to closed.
  • resolution set to duplicate.

04/03/08 03:55:43 changed by kangax

duplicate of which one? : )

04/03/08 12:09:04 changed by jdalton

dup or really really close to :
http://dev.rubyonrails.org/ticket/10226

I put a reference to this ticket in that one.