Closed milisarge closed 2 months ago
I forked my project from loure-views, i defined the key in Keyboard.cpp but it also triggers core definition, my terminal app and weston-terminal are opening at the same time when i press F1 :) i would like to modify without hacking the core lib.
Louvre View should have disabled F1 key from this from this:
https://github.com/CuarzoSoftware/Louvre/blob/main/src/examples/louvre-views/src/Keyboard.cpp https://github.com/CuarzoSoftware/Louvre/blob/main/src/examples/louvre-views/src/Compositor.cpp#L142
This is weird, definitely needs more investigating.
There are custom flags you can pass to LScene event handlers. Check LScene::handleKeyboardKeyEvent(), so you don't have to write it yourself.
By default, all are set. In this case, you should remove the AuxFunc flag.
scene.handleKeyboardKeyEvent(event, LScene::WaylandEvents);
Keep in mind that other shortcuts, such as exiting the compositor with Ctrl + Shift + Esc
, will also be disabled.
Here is the default implementation: LKeyboard::keyEvent()
I think this detail should be added to the base tutorial/documentation.
Sorry, i could not follow how can i overwriting the F1 key binding by using LScene::handleKeyboardKeyEvent
You need to explicitly set LScene::WaylandEvents
as the second argument of LScene::handleKeyboardKeyEvent()
.
When i look at the F1 key, it is predefined with weston-terminal (https://github.com/CuarzoSoftware/Louvre/blob/980bf1a06db95b94b22e46e07ffb25f15380129e/src/lib/core/default/LKeyboardDefault.cpp#L47),
If i want to re-define it with my terminal application, which way is the proper way of doing it?
By the way, i am using Louvre core library, just curious why keyboard definitions are embed in the core library?