Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
b08b027a
Unverified
Commit
b08b027a
authored
May 22, 2020
by
bruvzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Block WM_MOUSEMOVE during Windows Ink pen handling.
parent
0b8cb945
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
+43
-3
display_server_windows.cpp
platform/windows/display_server_windows.cpp
+33
-2
display_server_windows.h
platform/windows/display_server_windows.h
+9
-0
os_windows.cpp
platform/windows/os_windows.cpp
+1
-1
No files found.
platform/windows/display_server_windows.cpp
View file @
b08b027a
...
...
@@ -2007,11 +2007,37 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
old_x
=
mm
->
get_position
().
x
;
old_y
=
mm
->
get_position
().
y
;
if
(
windows
[
window_id
].
window_has_focus
)
Input
::
get_singleton
()
->
pars
e_input_event
(
mm
);
Input
::
get_singleton
()
->
accumulat
e_input_event
(
mm
);
}
return
0
;
}
}
break
;
case
WM_POINTERENTER
:
{
if
(
mouse_mode
==
MOUSE_MODE_CAPTURED
&&
use_raw_input
)
{
break
;
}
if
((
OS
::
get_singleton
()
->
get_current_tablet_driver
()
!=
"winink"
)
||
!
winink_available
)
{
break
;
}
uint32_t
pointer_id
=
LOWORD
(
wParam
);
POINTER_INPUT_TYPE
pointer_type
=
PT_POINTER
;
if
(
!
win8p_GetPointerType
(
pointer_id
,
&
pointer_type
))
{
break
;
}
if
(
pointer_type
!=
PT_PEN
)
{
break
;
}
windows
[
window_id
].
block_mm
=
true
;
return
0
;
}
break
;
case
WM_POINTERLEAVE
:
{
windows
[
window_id
].
block_mm
=
false
;
return
0
;
}
break
;
case
WM_POINTERUPDATE
:
{
if
(
mouse_mode
==
MOUSE_MODE_CAPTURED
&&
use_raw_input
)
{
break
;
...
...
@@ -2127,12 +2153,16 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
old_x
=
mm
->
get_position
().
x
;
old_y
=
mm
->
get_position
().
y
;
if
(
windows
[
window_id
].
window_has_focus
)
{
Input
::
get_singleton
()
->
pars
e_input_event
(
mm
);
Input
::
get_singleton
()
->
accumulat
e_input_event
(
mm
);
}
return
0
;
//Pointer event handled return 0 to avoid duplicate WM_MOUSEMOVE event
}
break
;
case
WM_MOUSEMOVE
:
{
if
(
windows
[
window_id
].
block_mm
)
{
break
;
}
if
(
mouse_mode
==
MOUSE_MODE_CAPTURED
&&
use_raw_input
)
{
break
;
}
...
...
@@ -2732,6 +2762,7 @@ void DisplayServerWindows::_process_key_events() {
void
DisplayServerWindows
::
_update_tablet_ctx
(
const
String
&
p_old_driver
,
const
String
&
p_new_driver
)
{
for
(
Map
<
WindowID
,
WindowData
>::
Element
*
E
=
windows
.
front
();
E
;
E
=
E
->
next
())
{
WindowData
&
wd
=
E
->
get
();
wd
.
block_mm
=
false
;
if
((
p_old_driver
==
"wintab"
)
&&
wintab_available
&&
wd
.
wtctx
)
{
wintab_WTEnable
(
wd
.
wtctx
,
false
);
wintab_WTClose
(
wd
.
wtctx
);
...
...
platform/windows/display_server_windows.h
View file @
b08b027a
...
...
@@ -229,6 +229,14 @@ typedef struct tagPOINTER_PEN_INFO {
#define WM_POINTERUPDATE 0x0245
#endif
#ifndef WM_POINTERENTER
#define WM_POINTERENTER 0x0249
#endif
#ifndef WM_POINTERLEAVE
#define WM_POINTERLEAVE 0x024A
#endif
typedef
BOOL
(
WINAPI
*
GetPointerTypePtr
)(
uint32_t
p_id
,
POINTER_INPUT_TYPE
*
p_type
);
typedef
BOOL
(
WINAPI
*
GetPointerPenInfoPtr
)(
uint32_t
p_id
,
POINTER_PEN_INFO
*
p_pen_info
);
...
...
@@ -333,6 +341,7 @@ private:
int
min_pressure
;
int
max_pressure
;
bool
tilt_supported
;
bool
block_mm
=
false
;
int
last_pressure_update
;
float
last_pressure
;
...
...
platform/windows/os_windows.cpp
View file @
b08b027a
...
...
@@ -786,7 +786,7 @@ String OS_Windows::get_tablet_driver_name(int p_driver) const {
if
(
p_driver
<
0
||
p_driver
>=
tablet_drivers
.
size
())
{
return
""
;
}
else
{
return
tablet_drivers
[
p_driver
]
.
utf8
().
get_data
()
;
return
tablet_drivers
[
p_driver
];
}
}
...
...
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