Project

General

Profile

Feature #8458

WKeyEvent don't give access to JavaScriptEvent jsEvent_ on wt4

Added by José Luis Rey about 1 month ago. Updated 29 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/05/2021
Due date:
% Done:

0%

Estimated time:

Description

Hello,

I'm porting a big application from wt3 to wt4, in my old application I was using keyevent to check some accels (like ctrl+numpad, etc), but with the new structure, I cannot access jsEvent_.keyCode (but I can see that the values are there on the debugger).

It's possible to add a getJsEvent() { return jsEvent_; } method to the WKeyEvent class for next releases?

Any workaround for the current release?

Kind regards

#1

Updated by Korneel Dumon about 1 month ago

Hi,
can't you get the necessary info from WKeyEvent::key() and WKeyEvent::modifiers()? As far as I can tell, the numpad keys should be mapped to a Wt::Key value.

#2

Updated by José Luis Rey about 1 month ago

No, it is not possible, the WKeyEvent value is set to (0) when the value is not in the enum (that only includes basic keys).

The correct values are clearly visible on the debugger on the jsEvent_ member but are not accessible. All this info was accessible on wt3 without problems.

Kr

#3

Updated by Korneel Dumon 29 days ago

Hi,
I lost track of this for a while. Can you be more specific about what is not working? I tested with Ctrl-numpad and I get a value for Wt::Key::Key_*.
I think it would be cleaner to keep it private, but if you have a good example to convince us otherwise, maybe.

Also available in: Atom PDF