Kaydet (Commit) b80be502 authored tarafından Niklas Johansson's avatar Niklas Johansson Kaydeden (comit) Caolán McNamara

Allow non ASCII chars as accelerator keys

Non ASCII characters like åäö can be used as accelerator keys (Alt+<x>).
This already works however at the moment it is not exposed properly
to accessibility tools such as screen readers. After this patch at least
NVDA gets information about accelerator keys that are non ascii. On
Linux we need to adapt code in vcl/unx/atk/a11y/atkaction.cxx.

There is also vcl/source/window/dlgctrl.cxx#Window::GetActivationKey
should probably have similar treatment and I guess that it is related
to accelerator keys in dialogs but I need to confirm that.
I'm a bit unsure how to best do that so I'll save it for later.

Change-Id: I1f1509a26d781011d217670266bd10b2107811d5
Reviewed-on: https://gerrit.libreoffice.org/19078Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d2281e20
......@@ -862,8 +862,8 @@ KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const
nCode = KEY_A + (cAccel-'A');
else if( cAccel >= '0' && cAccel <= '9' )
nCode = KEY_0 + (cAccel-'0');
if(nCode )
aRet = KeyEvent( cAccel, KeyCode( nCode, KEY_MOD2 ) );
aRet = KeyEvent( cAccel, KeyCode( nCode, KEY_MOD2 ) );
}
}
......
......@@ -285,32 +285,8 @@ void CAccActionBase::GetkeyBindingStrByXkeyBinding( const Sequence< KeyStroke >
{
KeyStroke stroke = keySet[iIndex];
OLECHAR wString[64] = {NULL};
if(iIndex>0)
wcscat( wString, OLESTR(" ") );
if((stroke.Modifiers & MODIFIER_SHIFT) == MODIFIER_SHIFT)
wcscat( wString, OLESTR("Shift+") );
if((stroke.Modifiers & MODIFIER_CTRL) == MODIFIER_CTRL)
wcscat( wString, OLESTR("Ctrl+") );
if((stroke.Modifiers & MODIFIER_ALT) == MODIFIER_ALT)
wcscat( wString, OLESTR("Alt+") );
if(stroke.KeyCode)
{
OLECHAR* pChar = getOLECHARFromKeyCode(stroke.KeyCode);
if(pChar != NULL)
wcscat( wString, pChar );
else if (stroke.KeyCode <= 255)
{
OLECHAR pChar[4] = {NULL};
swprintf( pChar, L"%c", stroke.KeyCode);
wcscat( wString, pChar);
}
else
{
OLECHAR pChar[4] = {NULL};
swprintf( pChar, L"%d", stroke.KeyCode);
wcscat( wString, pChar);
}
}
wcscat(wString, OLESTR("\n"));
wcscat(wString, &stroke.KeyChar);
wcscat( pString, wString);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment