mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 19:45:08 +00:00
LibGUI: Don't enter TableView edit mode when a control key is pressed
A key press, which is an ASCII control character will no longer cause TableView to begin editing. This fixes an issue in Spreadsheet where navigating to a cell then pressing escape would cause a that cell's text to be set to a non-printable value. Pressing escape after navigating to a cell now has no effect.
This commit is contained in:
parent
4e2e2027c3
commit
361e29cfc9
1 changed files with 2 additions and 2 deletions
|
@ -194,8 +194,8 @@ void TableView::keydown_event(KeyEvent& event)
|
|||
auto is_delete = event.key() == Key_Delete;
|
||||
auto is_backspace = event.key() == Key_Backspace;
|
||||
auto is_clear = is_delete || is_backspace;
|
||||
auto has_ctrl = event.modifiers() & KeyModifier::Mod_Ctrl;
|
||||
if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear) && !has_ctrl) {
|
||||
auto is_control_character = is_ascii_c0_control(event.code_point());
|
||||
if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && !event.ctrl() && (!is_control_character || is_clear)) {
|
||||
begin_editing(cursor_index());
|
||||
if (m_editing_delegate) {
|
||||
if (is_delete) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue