use keycode/charcode for particular key events

git-svn-id: svn://10.0.0.236/trunk@43027 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brade%netscape.com
1999-08-10 21:34:48 +00:00
parent bb427f4301
commit 4fa3366433

View File

@@ -263,12 +263,16 @@ nsresult nsXULKeyListenerImpl::DoKey(nsIDOMEvent* aKeyEvent, eEventType aEventTy
keyElement->GetAttribute(nsAutoString("disabled"), disabled);
if (disabled == "false") {
PRUint32 theChar;
// #ifdef XP_PC
// theEvent->GetCharCode(&theChar);
// #else
theEvent->GetKeyCode(&theChar);
// #endif
//printf("event key [%c] \n", theChar); // this leaks
switch(aEventType) {
case eKeyPress:
theEvent->GetCharCode(&theChar);
break;
case eKeyUp:
case eKeyDown:
theEvent->GetKeyCode(&theChar);
break;
}
char tempChar[2];
tempChar[0] = theChar;