Opened 10 years ago
Closed 13 months ago
#1393 closed enhancement (fixed)
Gecko.js, Opera.js must change to use keydown event in isKeyEvent(). Add event onKeyDown, onKeyEvent, change onKeyPress definition
Reported by: | guest | Owned by: | gogo |
---|---|---|---|
Priority: | normal | Milestone: | 2.0 |
Component: | Xinha Core | Version: | trunk |
Severity: | normal | Keywords: | event onKeyDown |
Cc: | adam@… |
Description
Can we have an event for onKeyDown please
e.g.
xinha_config.Events.onKeyDown
we currently have onKeyPress - but that fires too late.
Adam J
Change History (4)
comment:1 Changed 9 years ago by gogo
- Summary changed from event onKeyDown to Gecko.js, Opera.js must change to use keydown event in isKeyEvent(). Add event onKeyDown, onKeyEvent, change onKeyPress definition
comment:2 Changed 9 years ago by gogo
- Milestone changed from 0.96 to 2.0
comment:3 Changed 8 years ago by adamj
a quick fix is to edit Gecko.js:
change
Xinha.prototype.isKeyEvent = function(event)
{
return event.type == "keypress";
}
to:
Xinha.prototype.isKeyEvent = function(event)
{
return event.type == "keydown";
}
which works fine for me.
comment:4 Changed 13 months ago by gogo
- Resolution set to fixed
- Status changed from new to closed
[1394] Reworks the keyboard event handling code so you now have onKeyDown, onKeyPress, onShortCut, onKeyUp in something like that order (for purposes of cancelling).
onKeyPress should continue to work without change.
See ticket #1274
But the individual browser modules have different ideas on what isKeyEvent() does...
Changeset:1039 chganged it to keydown for WebKit?.js, InternetExplorer?.js has always used keydown.
The reason is that "special" keys (non printables, meta) apparantly do not trigger a keypress event in those browsers.
I'm not sure what the best resolution to this is.
The onKeyPress event is badly named, it should be onKeyEvent, then we could look at changing both Gecko and Opera to use "keydown" for that, and introduce a new onKeyPress and onKeyDown plugin events (and onKeyUp etc). But this would require...
Does somebody have time and energy to do that?