Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Capture '{' key press in RichTextEditor

    I am running SmartGwt from november 2010, on Windows 7.

    I have a RichTextEditor, and I need to manage '{'-key strokes. However, it seems that unlike the KeyPressEvent that gets fired from the TextAreaItem, the KeyPressEvent fired from this widget does not have the functionality of getting the KeyCode, just the KeyName. The docs tell me that the curly bracket will have the same value as the hard bracket, but this is not true. When printing the keyname of the curly bracket I get ` as output. Also, there is no way of checking whether or not the shift key is pressed, so even if the value was the same, I would still not be able to distinguish between { and [.

    So, how can I capture '{' key press in a RichTextEditor?

    #2
    Hi Banang,
    You can use the EventHandler utility class to pick up full details of the current key event -- see getKey(), getKeyEventCharacter(), getKeyEventCharacterValue() and shiftKeyDown() methods.

    However the fact that the keyName is being reported as ` rather than [ sounds like a real bug. We're not reproducing this on our end. What browser are you seeing this on? Any chance you can post a standalone test case that demonstrates the problem?

    Thanks
    Isomorphic Software

    Comment

    Working...
    X