Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
OIS
Commits
07649449
Commit
07649449
authored
Jun 22, 2016
by
Ondřej Janošík
Browse files
Support for forward/backward mouse buttons on Linux
parent
bb75ccc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/linux/LinuxMouse.cpp
src/linux/LinuxMouse.cpp
+4
-3
No files found.
src/linux/LinuxMouse.cpp
View file @
07649449
...
...
@@ -153,7 +153,8 @@ void LinuxMouse::capture()
void
LinuxMouse
::
_processXEvents
()
{
//X11 Button Events: 1=left 2=middle 3=right; Our Bit Postion: 1=Left 2=Right 3=Middle
char
mask
[
4
]
=
{
0
,
1
,
4
,
2
};
//X11 Button Events: 8=backward 9=forward; Our Bit Position: 4=backward 5=forward
char
mask
[
10
]
=
{
0
,
1
,
4
,
2
,
0
,
0
,
0
,
0
,
8
,
10
};
XEvent
event
;
//Poll x11 for events mouse events
...
...
@@ -216,7 +217,7 @@ void LinuxMouse::_processXEvents()
{
//Button down
static_cast
<
LinuxInputManager
*>
(
mCreator
)
->
_setGrabState
(
true
);
if
(
event
.
xbutton
.
button
<
4
)
if
(
event
.
xbutton
.
button
<
10
&&
mask
[
event
.
xbutton
.
button
]
)
{
mState
.
buttons
|=
mask
[
event
.
xbutton
.
button
];
if
(
mBuffered
&&
mListener
)
...
...
@@ -227,7 +228,7 @@ void LinuxMouse::_processXEvents()
}
else
if
(
event
.
type
==
ButtonRelease
)
{
//Button up
if
(
event
.
xbutton
.
button
<
4
)
if
(
event
.
xbutton
.
button
<
10
&&
mask
[
event
.
xbutton
.
button
]
)
{
mState
.
buttons
&=
~
mask
[
event
.
xbutton
.
button
];
if
(
mBuffered
&&
mListener
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment