svx/source/dialog/charmap.cxx       |    5 +++--
 svx/source/dialog/searchcharmap.cxx |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit d1f5b3c5cb226fd5f58fe2cdc8be9d1330fad6a2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Apr 1 23:35:50 2023 +0300
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Apr 3 17:00:23 2023 +0200

    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.wegh...@posteo.de>

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 );
 }

Reply via email to