Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <com/sun/star/awt/KeyEvent.hpp>
22 : #include <com/sun/star/awt/KeyModifier.hpp>
23 : #include <tools/debug.hxx>
24 : #include <vcl/event.hxx>
25 :
26 0 : KeyEvent::KeyEvent (const KeyEvent& rKeyEvent) :
27 : maKeyCode (rKeyEvent.maKeyCode),
28 : mnRepeat (rKeyEvent.mnRepeat),
29 0 : mnCharCode(rKeyEvent.mnCharCode)
30 0 : {}
31 :
32 0 : KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
33 : {
34 0 : KeyEvent aClone(*this);
35 :
36 0 : sal_uInt16 nCode = maKeyCode.GetCode();
37 0 : sal_uInt16 nMod = maKeyCode.GetAllModifier();
38 :
39 0 : switch (eMode)
40 : {
41 : case TextDirectionality_RightToLeft_TopToBottom:
42 0 : switch (nCode)
43 : {
44 0 : case KEY_LEFT: aClone.maKeyCode = KeyCode(KEY_RIGHT, nMod); break;
45 0 : case KEY_RIGHT: aClone.maKeyCode = KeyCode(KEY_LEFT, nMod); break;
46 : }
47 0 : break;
48 :
49 : case TextDirectionality_TopToBottom_RightToLeft:
50 0 : switch (nCode)
51 : {
52 0 : case KEY_DOWN: aClone.maKeyCode = KeyCode(KEY_RIGHT, nMod); break;
53 0 : case KEY_UP: aClone.maKeyCode = KeyCode(KEY_LEFT, nMod); break;
54 0 : case KEY_LEFT: aClone.maKeyCode = KeyCode(KEY_DOWN, nMod); break;
55 0 : case KEY_RIGHT: aClone.maKeyCode = KeyCode(KEY_UP, nMod); break;
56 : }
57 0 : break;
58 :
59 : case TextDirectionality_LeftToRight_TopToBottom:
60 : /* do nothing */
61 0 : break;
62 : }
63 :
64 0 : return aClone;
65 : }
66 :
67 :
68 : // -------------------------------------------------------
69 :
70 0 : const Point& HelpEvent::GetMousePosPixel() const
71 : {
72 : //DBG_ASSERT( !mbKeyboardActivated, "Keyboard help has no mouse position !");
73 0 : return maPos;
74 : }
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|