mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 19:21:52 +00:00
LibGUI: Allow activating a focused button by pressing the space key :^)
This applies to normal push buttons, checkboxes, and radio buttons. It feels very natural. Even moreso than activating with return..
This commit is contained in:
parent
b7dfa83223
commit
06b5d292d7
Notes:
sideshowbarker
2024-07-19 01:41:56 +09:00
Author: https://github.com/awesomekling
Commit: 06b5d292d7
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ void AbstractButton::leave_event(Core::Event&)
|
||||||
|
|
||||||
void AbstractButton::keydown_event(KeyEvent& event)
|
void AbstractButton::keydown_event(KeyEvent& event)
|
||||||
{
|
{
|
||||||
if (event.key() == KeyCode::Key_Return) {
|
if (event.key() == KeyCode::Key_Return || event.key() == KeyCode::Key_Space) {
|
||||||
click(event.modifiers());
|
click(event.modifiers());
|
||||||
event.accept();
|
event.accept();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue