|
|
| version 1.57, 2004/03/15 11:06:23 | version 1.58, 2004/03/24 17:11:09 |
|---|---|
| Line 1103 static pascal OSStatus np2appevent (Even | Line 1103 static pascal OSStatus np2appevent (Even |
| break; | break; |
| case kEventClassKeyboard: | case kEventClassKeyboard: |
| if (GetEventKind(event)==kEventRawKeyModifiersChanged) { | if (GetEventKind(event)==kEventRawKeyModifiersChanged) { |
| static UInt32 backup = 0; | static UInt32 backup = 0; |
| if (modif & shiftKey) keystat_senddata(0x70); | UInt32 change = backup ^ modif; |
| else keystat_senddata(0x70 | 0x80); | backup = modif; |
| if (modif & optionKey) keystat_senddata(0x73); | if (change & shiftKey) { |
| else keystat_senddata(0x73 | 0x80); | if (modif & shiftKey) keystat_senddata(0x70); |
| if (modif & controlKey) keystat_senddata(0x74); | else keystat_senddata(0x70 | 0x80); |
| else keystat_senddata(0x74 | 0x80); | } |
| if ((modif & alphaLock) != (backup & alphaLock)) { | if (change & optionKey) { |
| if (modif & optionKey) keystat_senddata(0x73); | |
| else keystat_senddata(0x73 | 0x80); | |
| } | |
| if (change & controlKey) { | |
| if (modif & controlKey) keystat_senddata(0x74); | |
| else keystat_senddata(0x74 | 0x80); | |
| } | |
| if (change & alphaLock) { | |
| keystat_senddata(0x71); | keystat_senddata(0x71); |
| backup = modif; | |
| } | } |
| result = noErr; | result = noErr; |
| } | } |