diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-09-29 16:21:04 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-09-29 16:21:04 -0400 |
commit | 49b7f991a509528302d2d1987d3f6c38bd108798 (patch) | |
tree | c205628d3f47dc5b8dc7fe79c74263bc3b5eea4a /vcl/win/source/window | |
parent | 13b0fc7375271ed58f563306ef57f81808ac9289 (diff) |
Ported autocorrect-accidental-caps-lock-vcl.diff from ooo-build.
Diffstat (limited to 'vcl/win/source/window')
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index f0ca1d68ef41..081bd4827a9b 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -3227,6 +3227,41 @@ SalFrame::SalPointerState WinSalFrame::GetPointerState() // ----------------------------------------------------------------------- +SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState() +{ + SalIndicatorState aState; + aState.mnState = 0; + if (::GetKeyState(VK_CAPITAL)) + aState.mnState |= INDICATOR_CAPSLOCK; + + if (::GetKeyState(VK_NUMLOCK)) + aState.mnState |= INDICATOR_NUMLOCK; + + if (::GetKeyState(VK_SCROLL)) + aState.mnState |= INDICATOR_SCROLLLOCK; + + return aState; +} + +void WinSalFrame::SimulateKeyPress( USHORT nKeyCode ) +{ + BYTE nVKey = 0; + switch (nKeyCode) + { + case KEY_CAPSLOCK: + nVKey = VK_CAPITAL; + break; + } + + if (nVKey > 0 && nVKey < 255) + { + ::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY, 0); + ::keybd_event(nVKey, 0x45, KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP, 0); + } +} + +// ----------------------------------------------------------------------- + void WinSalFrame::SetBackgroundBitmap( SalBitmap* ) { } |