mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
LibGUI: Add CTRL+Enter callback to TextEditor
This commit is contained in:
parent
883768c646
commit
7da0d94d03
2 changed files with 7 additions and 0 deletions
|
@ -781,6 +781,12 @@ void TextEditor::keydown_event(KeyEvent& event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.modifiers() == KeyModifier::Mod_Ctrl && event.key() == KeyCode::Key_Return) {
|
||||||
|
if (on_ctrl_return_pressed)
|
||||||
|
on_ctrl_return_pressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.key() == KeyCode::Key_Return) {
|
if (event.key() == KeyCode::Key_Return) {
|
||||||
if (on_return_pressed)
|
if (on_return_pressed)
|
||||||
on_return_pressed();
|
on_return_pressed();
|
||||||
|
|
|
@ -155,6 +155,7 @@ public:
|
||||||
Function<void()> on_mousedown;
|
Function<void()> on_mousedown;
|
||||||
Function<void()> on_return_pressed;
|
Function<void()> on_return_pressed;
|
||||||
Function<void()> on_shift_return_pressed;
|
Function<void()> on_shift_return_pressed;
|
||||||
|
Function<void()> on_ctrl_return_pressed;
|
||||||
Function<void()> on_escape_pressed;
|
Function<void()> on_escape_pressed;
|
||||||
Function<void()> on_up_pressed;
|
Function<void()> on_up_pressed;
|
||||||
Function<void()> on_down_pressed;
|
Function<void()> on_down_pressed;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue