diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-04-01 23:35:50 +0300 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-04-03 17:00:23 +0200 |
commit | d1f5b3c5cb226fd5f58fe2cdc8be9d1330fad6a2 (patch) | |
tree | 2741d3696956e38bf4b3e9e7275d2b0df27f4fbf /svx | |
parent | cb29cd301d6a493870d8efc233965658ae532206 (diff) |
tdf#153806 a11y: Improve keyboard interaction in special char dialog
Make interacting with the "Special Characters" dialog
using the keyboard more intuitive and consistent:
* Call the selection handler (that changes the "OK" button
to be sensitive) when a new entry is selected, as happens
e.g. when tabbing into the table of characters, at which
point the currently focused character is already considered
selected (as e.g. indicated by the fact that other UI elements
in the dialog are already updated according to that selection).
This previously required pressing the space key (or moving back
and forth using the arrow keys) for no apparent reason.
* When a character in the character table is selected,
insert it into the document when pressing the space
key, as happens when double-clicking the entry
using the mouse. Insertion using the space key
already works for the characters in the "Recent Characters"
and "Favorite Characters" sections below the table, so this also
makes the behavior more consistent within the dialog.
Change-Id: I35072f565b26d1f6c12c7dc8b7c6592f6a985a03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147657
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/charmap.cxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/searchcharmap.cxx | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index bb15cb1efc1f..ead099007295 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -398,8 +398,8 @@ bool SvxShowCharSet::KeyInput(const KeyEvent& rKEvt) switch (aCode.GetCode()) { case KEY_SPACE: - aSelectHdl.Call( this ); - break; + aDoubleClkHdl.Call(this); + return true; case KEY_LEFT: --tmpSelected; break; @@ -785,6 +785,7 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus) aNewAny <<= AccessibleStateType::SELECTED; pItem->m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny ); } + aSelectHdl.Call(this); #endif } aHighHdl.Call( this ); diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx index 0bbb88448be5..8303c5378d16 100644 --- a/svx/source/dialog/searchcharmap.cxx +++ b/svx/source/dialog/searchcharmap.cxx @@ -64,8 +64,8 @@ bool SvxSearchCharSet::KeyInput(const KeyEvent& rKEvt) switch (aCode.GetCode()) { case KEY_SPACE: - aSelectHdl.Call( this ); - break; + aDoubleClkHdl.Call(this); + return true; case KEY_LEFT: --tmpSelected; break; @@ -411,6 +411,7 @@ void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus) pItem->m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny ); } #endif + aSelectHdl.Call(this); } aHighHdl.Call( this ); } |