Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sinister Zeta Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sinister Zeta
Sinister Zeta Project
Commits
4ca6f8cd
Commit
4ca6f8cd
authored
4 years ago
by
NikolaBabic
Browse files
Options
Downloads
Patches
Plain Diff
Added MouseButtons interface
parent
7417edca
No related branches found
No related tags found
2 merge requests
!65
Prototype
,
!62
Feature multi key press
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/model/MouseButtons.java
+64
-0
64 additions, 0 deletions
src/model/MouseButtons.java
with
64 additions
and
0 deletions
src/model/MouseButtons.java
0 → 100644
+
64
−
0
View file @
4ca6f8cd
package
model
;
public
interface
MouseButtons
{
int
LEFTDOWN
=
0x0002
;
int
LEFTUP
=
0x0004
;
int
RIGHTDOWN
=
0x0008
;
int
RIGHTUP
=
0x0010
;
int
MIDDLEDOWN
=
0x0020
;
int
MIDDLEUP
=
0x0040
;
int
XDOWN
=
0x0080
;
int
XUP
=
0x0100
;
int
XBUTTON1
=
0x0001
;
int
XBUTTON2
=
0x0002
;
static
int
getDown
(
int
id
)
{
if
(
id
<
1
||
id
>
6
||
id
==
3
)
return
-
1
;
switch
(
id
)
{
case
1
:
return
LEFTDOWN
;
case
2
:
return
RIGHTDOWN
;
case
4
:
return
MIDDLEDOWN
;
case
5
:
case
6
:
return
XDOWN
;
default
:
throw
new
IllegalStateException
(
"Impossible case reached."
);
}
}
static
int
getUp
(
int
id
)
{
if
(
id
<
1
||
id
>
6
||
id
==
3
)
return
-
1
;
switch
(
id
)
{
case
1
:
return
LEFTUP
;
case
2
:
return
RIGHTUP
;
case
4
:
return
MIDDLEUP
;
case
5
:
case
6
:
return
XUP
;
default
:
throw
new
IllegalStateException
(
"Impossible case reached."
);
}
}
static
int
getXButton
(
int
id
)
{
if
(
id
==
5
)
{
return
XBUTTON1
;
}
else
if
(
id
==
6
)
{
return
XBUTTON2
;
}
else
{
return
-
1
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment