use keycode/charcode for particular key events

This commit is contained in:
brade%netscape.com 1999-08-10 21:34:48 +00:00
Родитель 421d0252fe
Коммит 54c490c229
1 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -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;