qkeyevent Ignore modifiers
-
How can i ignore modifiers and only show the actual key that was pressed?
E.g. I don't want to get the key for ( when I press shift+8 on a german layout. I want the key for 8.
edit: It would also be okay if I could simply disable the modifiers completely
-
How can i ignore modifiers and only show the actual key that was pressed?
E.g. I don't want to get the key for ( when I press shift+8 on a german layout. I want the key for 8.
edit: It would also be okay if I could simply disable the modifiers completely
@Megamouse Why don't you simply check http://doc.qt.io/qt-5/qkeyevent.html#modifiers? See http://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum
-
@Megamouse Why don't you simply check http://doc.qt.io/qt-5/qkeyevent.html#modifiers? See http://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum
-
@Megamouse
If you want to just know which key is pressed, look at http://doc.qt.io/qt-5/qkeyevent.html#key member function. Unlike http://doc.qt.io/qt-5/qkeyevent.html#text, the former gives the raw key, without applying modifiers to generate the corresponding Unicode character. -
@Megamouse
If you want to just know which key is pressed, look at http://doc.qt.io/qt-5/qkeyevent.html#key member function. Unlike http://doc.qt.io/qt-5/qkeyevent.html#text, the former gives the raw key, without applying modifiers to generate the corresponding Unicode character. -
@JonB key() returns different codes for let's say... 1 and shift+1 (namely ! on german keyboards).
but I need the same value regardless of the shift@Megamouse
From the docs, I would have expected http://doc.qt.io/qt-5/qkeyevent.html#key to returnQt::Key_1
(http://doc.qt.io/qt-5/qt.html#Key-enum) in both cases. What do they each return? -
@Megamouse
From the docs, I would have expected http://doc.qt.io/qt-5/qkeyevent.html#key to returnQt::Key_1
(http://doc.qt.io/qt-5/qt.html#Key-enum) in both cases. What do they each return? -
@Megamouse That's a bit of a blow, then! :(
-
@Megamouse
Then I think you'll have to go down to the level of http://doc.qt.io/qt-5/qkeyevent.html#nativeScanCodeDon't ask me where you look up its return values though, as I don't know that!
And if that doesn't work, and you/I don't see another method to get at raw keyboard keys, I can only see that you'll have to write a large
switch...case
statement onQKeyEvent::key()
for your keyboard!