Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Zachariah WW.
SRB2
Commits
ac74abb3
Commit
ac74abb3
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Fix directional / game input by forcing QWERTY for non-text input
parent
faeae694
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/screen.h
+3
-0
3 additions, 0 deletions
src/screen.h
src/sdl/i_video.c
+22
-9
22 additions, 9 deletions
src/sdl/i_video.c
with
25 additions
and
9 deletions
src/screen.h
+
3
−
0
View file @
ac74abb3
...
@@ -148,6 +148,9 @@ extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_fu
...
@@ -148,6 +148,9 @@ extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_fu
// wait for page flipping to end or not
// wait for page flipping to end or not
extern
consvar_t
cv_vidwait
;
extern
consvar_t
cv_vidwait
;
// This is an annoying place to put this cvar on
extern
consvar_t
cv_forceqwerty
;
// quick fix for tall/short skies, depending on bytesperpixel
// quick fix for tall/short skies, depending on bytesperpixel
extern
void
(
*
walldrawerfunc
)(
void
);
extern
void
(
*
walldrawerfunc
)(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/sdl/i_video.c
+
22
−
9
View file @
ac74abb3
...
@@ -102,6 +102,9 @@ static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff
...
@@ -102,6 +102,9 @@ static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff
UINT8
graphics_started
=
0
;
// Is used in console.c and screen.c
UINT8
graphics_started
=
0
;
// Is used in console.c and screen.c
// Lactozilla: keyboard input
consvar_t
cv_forceqwerty
=
{
"forceqwerty"
,
"On"
,
CV_SAVE
,
CV_OnOff
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
// To disable fullscreen at startup; is set in VID_PrepareModeList
// To disable fullscreen at startup; is set in VID_PrepareModeList
boolean
allow_fullscreen
=
false
;
boolean
allow_fullscreen
=
false
;
static
SDL_bool
disable_fullscreen
=
SDL_FALSE
;
static
SDL_bool
disable_fullscreen
=
SDL_FALSE
;
...
@@ -380,19 +383,26 @@ static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code, Uint32 type)
...
@@ -380,19 +383,26 @@ static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code, Uint32 type)
default:
break
;
default:
break
;
}
}
if
(
keycode
>=
SDLK_a
&&
keycode
<=
SDLK_z
)
// Tested by installing a French keymap
if
(
cv_forceqwerty
.
value
)
{
{
// get lowercase ASCII
if
(
code
>=
SDL_SCANCODE_A
&&
code
<=
SDL_SCANCODE_Z
)
return
keycode
-
SDLK_a
+
'a'
;
return
code
-
SDL_SCANCODE_A
+
'a'
;
else
if
(
code
>=
SDL_SCANCODE_1
&&
code
<=
SDL_SCANCODE_9
)
return
code
-
SDL_SCANCODE_1
+
'1'
;
else
if
(
code
==
SDL_SCANCODE_0
)
return
'0'
;
}
}
if
(
keycode
>=
SDLK_1
&&
keycode
<=
SDLK_9
)
else
{
{
if
(
keycode
>=
SDLK_a
&&
keycode
<=
SDLK_z
)
return
keycode
-
SDLK_a
+
'a'
;
else
if
(
keycode
>=
SDLK_1
&&
keycode
<=
SDLK_9
)
return
keycode
-
SDLK_1
+
'1'
;
return
keycode
-
SDLK_1
+
'1'
;
}
else
if
(
keycode
==
SDLK_0
)
else
if
(
keycode
==
SDLK_0
)
{
return
'0'
;
return
'0'
;
}
}
#ifdef HWRENDER
#ifdef HWRENDER
DBG_Printf
(
"Unknown incoming scancode: %d, represented %c
\n
"
,
DBG_Printf
(
"Unknown incoming scancode: %d, represented %c
\n
"
,
code
,
code
,
...
@@ -1668,6 +1678,9 @@ void I_StartupGraphics(void)
...
@@ -1668,6 +1678,9 @@ void I_StartupGraphics(void)
disable_mouse
=
M_CheckParm
(
"-nomouse"
);
disable_mouse
=
M_CheckParm
(
"-nomouse"
);
disable_fullscreen
=
M_CheckParm
(
"-win"
)
?
1
:
0
;
disable_fullscreen
=
M_CheckParm
(
"-win"
)
?
1
:
0
;
// Lactozilla
CV_RegisterVar
(
&
cv_forceqwerty
);
keyboard_started
=
true
;
keyboard_started
=
true
;
#if !defined(HAVE_TTF)
#if !defined(HAVE_TTF)
...
...
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