Bug #1197
closedWKeyEvent returns a wrong charCode and text
0%
Description
WKeyEvent returns a wrong charCode and text.
The documentation of WKeyEvent::charCode() states that: for WInteractWidget::keyWentDown and WInteractWidget::keyWentUp events, '0' is returned.
The documentation of WKeyEvent::text() states that: for the WInteractWidget::keyWentDown and WInteractWidget::keyWentUp events, an empty string is returned.
The widgetgallery example shows this information, so once this is fixed, the example should not show the text and charCode if charCode==0.
Updated by Koen Deforche over 12 years ago
- Status changed from New to InProgress
- Assignee set to Pieter Libin
- Target version set to 3.2.2
Updated by Pieter Libin over 12 years ago
- Status changed from InProgress to Resolved
Before closing this issue, we should test it with IE6!
Updated by Koen Deforche over 12 years ago
- Status changed from Resolved to Closed
Released in Wt 3.2.2
Updated by W X over 11 years ago
Hi,
In my application I need to catch KeyWentDown and KeyWentUp events and use the code of the key that was pressed/released. With wt.3.2.1 charCode() seem to do the job, but with wt.3.3.0 it doesn't work anymore (charCode() returns 0 as specified in docs after the change above).
I tried using the key() method, as recommended in the docs, but, for numerical keys for example, it returns 0. Using keyCode() is not of much help since it is marked as deprecated and the documentation says that it returns browser specific codes.
Is there a reliable way to get the key code on KeyWentDown and KeyWentUp events, with wt.3.3.0 ?
Thanks!