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
e460456e
Unverified
Commit
e460456e
authored
May 18, 2020
by
Eric Rybicki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix certain characters being recognized as special keys in Windows when using…
Fix certain characters being recognized as special keys in Windows when using the us international layout
parent
d4599fff
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
display_server_windows.cpp
platform/windows/display_server_windows.cpp
+2
-1
key_mapping_windows.cpp
platform/windows/key_mapping_windows.cpp
+13
-0
key_mapping_windows.h
platform/windows/key_mapping_windows.h
+1
-0
No files found.
platform/windows/display_server_windows.cpp
View file @
e460456e
...
...
@@ -2658,7 +2658,8 @@ void DisplayServerWindows::_process_key_events() {
KeyEvent
&
ke
=
key_event_buffer
[
i
];
switch
(
ke
.
uMsg
)
{
case
WM_CHAR
:
{
if
((
i
==
0
&&
ke
.
uMsg
==
WM_CHAR
)
||
(
i
>
0
&&
key_event_buffer
[
i
-
1
].
uMsg
==
WM_CHAR
))
{
// extended keys should only be processed as WM_KEYDOWN message.
if
(
!
KeyMappingWindows
::
is_extended_key
(
ke
.
wParam
)
&&
((
i
==
0
&&
ke
.
uMsg
==
WM_CHAR
)
||
(
i
>
0
&&
key_event_buffer
[
i
-
1
].
uMsg
==
WM_CHAR
)))
{
Ref
<
InputEventKey
>
k
;
k
.
instance
();
...
...
platform/windows/key_mapping_windows.cpp
View file @
e460456e
...
...
@@ -411,3 +411,16 @@ unsigned int KeyMappingWindows::get_scansym(unsigned int p_code, bool p_extended
return
keycode
;
}
bool
KeyMappingWindows
::
is_extended_key
(
unsigned
int
p_code
)
{
return
p_code
==
VK_INSERT
||
p_code
==
VK_DELETE
||
p_code
==
VK_HOME
||
p_code
==
VK_END
||
p_code
==
VK_PRIOR
||
p_code
==
VK_NEXT
||
p_code
==
VK_LEFT
||
p_code
==
VK_UP
||
p_code
==
VK_RIGHT
||
p_code
==
VK_DOWN
;
}
platform/windows/key_mapping_windows.h
View file @
e460456e
...
...
@@ -43,6 +43,7 @@ class KeyMappingWindows {
public
:
static
unsigned
int
get_keysym
(
unsigned
int
p_code
);
static
unsigned
int
get_scansym
(
unsigned
int
p_code
,
bool
p_extended
);
static
bool
is_extended_key
(
unsigned
int
p_code
);
};
#endif // KEY_MAPPING_WINDOWS_H
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