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
07002bf8
Commit
07002bf8
authored
4 years ago
by
Dallin Nickel (djn011)
Browse files
Options
Downloads
Patches
Plain Diff
Moved the keylistener to its own seperate class
parent
0f262d77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!65
Prototype
,
!52
Feature addmacros
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Controller/KeyListener.java
+32
-0
32 additions, 0 deletions
src/Controller/KeyListener.java
with
32 additions
and
0 deletions
src/Controller/KeyListener.java
0 → 100644
+
32
−
0
View file @
07002bf8
package
Controller
;
import
model.OSInterface
;
import
org.jnativehook.keyboard.NativeKeyEvent
;
import
org.jnativehook.keyboard.NativeKeyListener
;
import
static
Controller
.
KeyConversion
.
map
;
import
static
ui
.
MainScreen
.
dict
;
public
class
KeyListener
implements
NativeKeyListener
{
public
KeyListener
(){}
@Override
public
void
nativeKeyPressed
(
NativeKeyEvent
nativeKeyEvent
)
{
try
{
OSInterface
.
getInstance
().
sendKey
(
dict
.
get
(
map
.
get
(
nativeKeyEvent
.
getKeyCode
())),
true
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
map
.
get
(
nativeKeyEvent
.
getKeyCode
()));
}
}
@Override
public
void
nativeKeyReleased
(
NativeKeyEvent
nativeKeyEvent
)
{
}
@Override
public
void
nativeKeyTyped
(
NativeKeyEvent
nativeKeyEvent
)
{
}
}
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