Keyboard interpreter needs to create non-character KeyEvents differently

Project:JNode Core
Component:Code
Category:bug report
Priority:normal
Assigned:Stephen Crawley
Status:closed
Description

Currently, a KeyEvent generated for a non-character keystroke will return 0x0000 as its keyChar value. I think that the correct behaviour is to return KeyEvent.CHAR_UNKNOWN. This is 0xffff which is a Unicode code point that is reserved for internal use.

This is a portability issue: I've already found one JNode application (TextEditor) that has been coded to expect KeyEvents for virtual keys to have a zero keyChar value. It will also be a problem for JNode applications that need the user to be able to enter ASCII NUL characters from the keyboard.

#1

Assigned to:Anonymous» Stephen Crawley
Status:active» patch (code needs review)

I've developed a patch that I think should address this issue. I've tested it on my machine (US keyboard) from the JNode console and the GUI. But I don't know if there are other ways that I need to test it. So I'm asking other folks who are are more familiar with how various JNode tools (editors, games, etc) normally behave to please try out my patch and see if it breaks anything.

If I don't hear of any problems in (say) a week, I'll commit the changes.

AttachmentSize
keyboardinterpreter.patch7.2 KB

#2

Status:patch (code needs review)» fixed

Patch applied. Marking issue as fixed.

#3

Status:fixed» closed

Closing manually.