LibreOffice Module vcl (master)
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
vcl
source
window
keyevent.cxx
Go to the documentation of this file.
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
#include <
vcl/event.hxx
>
21
22
KeyEvent
KeyEvent::LogicalTextDirectionality
(
TextDirectionality
eMode)
const
23
{
24
KeyEvent
aClone(*
this
);
25
26
sal_uInt16
nCode
=
maKeyCode
.
GetCode
();
27
sal_uInt16 nMod =
maKeyCode
.
GetModifier
();
28
29
switch
(eMode)
30
{
31
case
TextDirectionality::RightToLeft_TopToBottom
:
32
switch
(nCode)
33
{
34
case
KEY_LEFT
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_RIGHT
, nMod);
break
;
35
case
KEY_RIGHT
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_LEFT
, nMod);
break
;
36
}
37
break
;
38
39
case
TextDirectionality::TopToBottom_RightToLeft
:
40
switch
(nCode)
41
{
42
case
KEY_DOWN
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_RIGHT
, nMod);
break
;
43
case
KEY_UP
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_LEFT
, nMod);
break
;
44
case
KEY_LEFT
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_DOWN
, nMod);
break
;
45
case
KEY_RIGHT
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_UP
, nMod);
break
;
46
}
47
break
;
48
49
case
TextDirectionality::BottomToTop_LeftToRight
:
50
switch
(nCode)
51
{
52
case
KEY_DOWN
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_LEFT
, nMod);
break
;
53
case
KEY_UP
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_RIGHT
, nMod);
break
;
54
case
KEY_LEFT
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_UP
, nMod);
break
;
55
case
KEY_RIGHT
: aClone.
maKeyCode
=
vcl::KeyCode
(
KEY_DOWN
, nMod);
break
;
56
}
57
break
;
58
59
case
TextDirectionality::LeftToRight_TopToBottom
:
60
/* do nothing */
61
break
;
62
}
63
64
return
aClone;
65
}
66
67
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl::KeyCode::GetCode
sal_uInt16 GetCode() const
Definition:
keycod.hxx:51
TextDirectionality
TextDirectionality
Definition:
event.hxx:34
KEY_UP
constexpr sal_uInt16 KEY_UP
Definition:
keycodes.hxx:111
TextDirectionality::RightToLeft_TopToBottom
vcl::KeyCode::GetModifier
sal_uInt16 GetModifier() const
Definition:
keycod.hxx:54
KeyEvent::maKeyCode
vcl::KeyCode maKeyCode
Definition:
event.hxx:44
nCode
sal_uInt16 nCode
KEY_DOWN
constexpr sal_uInt16 KEY_DOWN
Definition:
keycodes.hxx:110
TextDirectionality::TopToBottom_RightToLeft
KEY_RIGHT
constexpr sal_uInt16 KEY_RIGHT
Definition:
keycodes.hxx:113
event.hxx
TextDirectionality::BottomToTop_LeftToRight
vcl::KeyCode
Definition:
keycod.hxx:36
KEY_LEFT
constexpr sal_uInt16 KEY_LEFT
Definition:
keycodes.hxx:112
TextDirectionality::LeftToRight_TopToBottom
KeyEvent::LogicalTextDirectionality
KeyEvent LogicalTextDirectionality(TextDirectionality eMode) const
Definition:
keyevent.cxx:22
KeyEvent
Definition:
event.hxx:41
Generated on Thu Jan 14 2021 06:20:49 for LibreOffice Module vcl (master) by
1.8.10