Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DasherVR
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
DasherVR
Commits
3f5770f4
Commit
3f5770f4
authored
1 year ago
by
Sebastian Pape
Browse files
Options
Downloads
Patches
Plain Diff
Fixing some input handling
parent
42dffd0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/DasherVR/Private/SDasherWidget.cpp
+7
-8
7 additions, 8 deletions
Source/DasherVR/Private/SDasherWidget.cpp
with
7 additions
and
8 deletions
Source/DasherVR/Private/SDasherWidget.cpp
+
7
−
8
View file @
3f5770f4
...
@@ -38,13 +38,13 @@ FReply SDasherWidget::OnMouseButtonDown(const FGeometry& MyGeometry, const FPoin
...
@@ -38,13 +38,13 @@ FReply SDasherWidget::OnMouseButtonDown(const FGeometry& MyGeometry, const FPoin
FMouseState
&
MouseState
=
GetMouseState
(
MouseEvent
.
GetPointerIndex
());
FMouseState
&
MouseState
=
GetMouseState
(
MouseEvent
.
GetPointerIndex
());
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
LeftMouseButton
)
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
LeftMouseButton
&&
!
MouseState
.
PrimaryButtonPressed
)
{
{
DasherMainInterface
->
KeyDown
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Primary_Input
);
DasherMainInterface
->
KeyDown
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Primary_Input
);
MouseState
.
PrimaryButtonPressed
=
true
;
MouseState
.
PrimaryButtonPressed
=
true
;
MouseListeners
.
ExecuteIfBound
(
MouseEvent
.
GetPointerIndex
(),
MouseState
.
PrimaryButtonPressed
);
MouseListeners
.
ExecuteIfBound
(
MouseEvent
.
GetPointerIndex
(),
MouseState
.
PrimaryButtonPressed
);
}
}
else
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
RightMouseButton
)
else
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
RightMouseButton
&&
!
MouseState
.
SecondaryButtonPressed
)
{
{
DasherMainInterface
->
KeyDown
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Secondary_Input
);
DasherMainInterface
->
KeyDown
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Secondary_Input
);
MouseState
.
SecondaryButtonPressed
=
true
;
MouseState
.
SecondaryButtonPressed
=
true
;
...
@@ -127,9 +127,10 @@ void SDasherWidget::OnMouseLeave(const FPointerEvent& MouseEvent)
...
@@ -127,9 +127,10 @@ void SDasherWidget::OnMouseLeave(const FPointerEvent& MouseEvent)
{
{
SWidget
::
OnMouseLeave
(
MouseEvent
);
SWidget
::
OnMouseLeave
(
MouseEvent
);
if
(
InputPaused
)
return
;
FMouseState
&
MouseState
=
GetMouseState
(
MouseEvent
.
GetPointerIndex
());
FMouseState
&
MouseState
=
GetMouseState
(
MouseEvent
.
GetPointerIndex
());
MouseState
.
CurrentlyHovering
=
false
;
if
(
InputPaused
)
return
;
if
(
MouseState
.
PrimaryButtonPressed
)
if
(
MouseState
.
PrimaryButtonPressed
)
{
{
...
@@ -144,8 +145,6 @@ void SDasherWidget::OnMouseLeave(const FPointerEvent& MouseEvent)
...
@@ -144,8 +145,6 @@ void SDasherWidget::OnMouseLeave(const FPointerEvent& MouseEvent)
BoostListeners
.
ExecuteIfBound
(
MouseEvent
.
GetPointerIndex
(),
false
);
BoostListeners
.
ExecuteIfBound
(
MouseEvent
.
GetPointerIndex
(),
false
);
MouseState
.
DisabledDueToMouseLeave
=
true
;
MouseState
.
DisabledDueToMouseLeave
=
true
;
}
}
MouseState
.
CurrentlyHovering
=
false
;
}
}
FReply
SDasherWidget
::
OnMouseButtonDoubleClick
(
const
FGeometry
&
InMyGeometry
,
const
FPointerEvent
&
InMouseEvent
)
FReply
SDasherWidget
::
OnMouseButtonDoubleClick
(
const
FGeometry
&
InMyGeometry
,
const
FPointerEvent
&
InMouseEvent
)
...
@@ -157,13 +156,13 @@ FReply SDasherWidget::OnMouseButtonUp(const FGeometry& MyGeometry, const FPointe
...
@@ -157,13 +156,13 @@ FReply SDasherWidget::OnMouseButtonUp(const FGeometry& MyGeometry, const FPointe
{
{
FMouseState
&
MouseState
=
GetMouseState
(
MouseEvent
.
GetPointerIndex
());
FMouseState
&
MouseState
=
GetMouseState
(
MouseEvent
.
GetPointerIndex
());
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
LeftMouseButton
)
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
LeftMouseButton
&&
MouseState
.
PrimaryButtonPressed
)
{
{
DasherMainInterface
->
KeyUp
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Primary_Input
);
DasherMainInterface
->
KeyUp
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Primary_Input
);
MouseState
.
PrimaryButtonPressed
=
false
;
MouseState
.
PrimaryButtonPressed
=
false
;
MouseListeners
.
ExecuteIfBound
(
MouseEvent
.
GetPointerIndex
(),
MouseState
.
PrimaryButtonPressed
);
MouseListeners
.
ExecuteIfBound
(
MouseEvent
.
GetPointerIndex
(),
MouseState
.
PrimaryButtonPressed
);
}
}
else
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
RightMouseButton
)
else
if
(
MouseEvent
.
GetEffectingButton
()
==
EKeys
::
RightMouseButton
&&
MouseState
.
SecondaryButtonPressed
)
{
{
DasherMainInterface
->
KeyUp
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Secondary_Input
);
DasherMainInterface
->
KeyUp
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Secondary_Input
);
MouseState
.
SecondaryButtonPressed
=
false
;
MouseState
.
SecondaryButtonPressed
=
false
;
...
...
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