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
6a0df699
Commit
6a0df699
authored
4 years ago
by
NikolaBabic
Browse files
Options
Downloads
Patches
Plain Diff
Added ability to launch applications from path
parent
82af72fb
No related branches found
No related tags found
2 merge requests
!65
Prototype
,
!51
Feature mouse speed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/model/OSInterface.java
+16
-0
16 additions, 0 deletions
src/model/OSInterface.java
with
16 additions
and
0 deletions
src/model/OSInterface.java
+
16
−
0
View file @
6a0df699
...
...
@@ -16,6 +16,7 @@ public class OSInterface implements HotkeyDetector, HotkeyRegistration, InputEmu
private
static
OSInterface
instance
=
null
;
private
User32
user32
=
User32
.
INSTANCE
;
Runtime
runtime
;
private
WinDef
.
HWND
hwnd
;
private
HashMap
<
Integer
,
Hotkey
>
registeredKeys
;
private
HashMap
<
Integer
,
Integer
>
pressedKeys
;
...
...
@@ -33,6 +34,7 @@ public class OSInterface implements HotkeyDetector, HotkeyRegistration, InputEmu
registeredKeys
=
new
HashMap
<>();
pressedKeys
=
new
HashMap
<>();
msg
=
new
WinUser
.
MSG
();
runtime
=
Runtime
.
getRuntime
();
hotkeyRegQueue
=
new
LinkedBlockingQueue
<>();
hotkeyUnRegQueue
=
new
LinkedBlockingQueue
<>();
keySendQueue
=
new
LinkedBlockingQueue
<>();
...
...
@@ -182,6 +184,10 @@ public class OSInterface implements HotkeyDetector, HotkeyRegistration, InputEmu
@Override
public
boolean
setMouseSpeed
(
int
speed
)
{
if
(
speed
<
1
||
speed
>
20
)
return
false
;
return
false
;
}
...
...
@@ -199,6 +205,16 @@ public class OSInterface implements HotkeyDetector, HotkeyRegistration, InputEmu
return
pressed
;
}
public
boolean
launchApplication
(
String
path
)
{
try
{
runtime
.
exec
(
path
);
return
true
;
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Error launching applications: "
+
e
.
getMessage
());
return
false
;
}
}
@Override
public
void
sendKey
(
int
keyCode
,
boolean
release
)
{
if
(
keyCode
>
0
&&
keyCode
<
255
)
{
...
...
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