Commit Graph

97 Commits

Author SHA1 Message Date
Shpoike 9f5d6f0355 Rework input accumulation to be a bit smoother. 2023-07-25 15:08:17 +01:00
Shpoike c0efc3bc9a Respond to mouse cursor positions but not relative motions when the window is not focused, no more looking around when tabbed out. 2023-07-10 03:08:57 +01:00
Shpoike 2c38d5b3e3 Merge remote-tracking branch 'sf/master' into qss 2023-03-18 12:38:25 +00:00
Chris Cowan 8d03392559 Prevent SDL_StartTextInput during single-letter y/n prompts
y/n prompts also support controller inputs, so we don't want to trigger an
onscreen keyboard for them.
2023-03-13 03:23:31 -07:00
Chris Cowan 0ce11a9117 controller: don't use right joystick for menu navigating 2023-03-11 10:11:01 +03:00
Chris Cowan 0cffb9548a Adjust joystick defaults closer to Kex
joy_sensitivity_{yaw,pitch} and joy_exponent{,_move} were both changed.

Decreasing joy_exponent{,_move} makes the joystick respond more at small
movements. joy_exponent and joy_exponent_move values of 2 give a response
curve more similar to Kex. The original value of 3 gives a response curve
that some might find better for slow precision aiming, but it creates a
sharper cliff between small inputs and large inputs that can make
smoothly adjusting your aim/movement at medium magnitudes difficult.

joy_sensitivity_{yaw,pitch} were decreased both to compensate for the
joy_exponent{,_move} change and to be closer to Kex's default.
2023-03-11 10:11:01 +03:00
Chris Cowan 68b9ca8906 Fix joystick movement threshold and run behavior
Fixes issue where holding the movement joystick at a 45 degree angle would
instead make you move at a 41 degree angle if you had "Always Run" set to
"Vanilla" or at a 60 degree angle.

Fixes issue where holding the movement joystick all the way while not running
would make you move at speed 283 instead of 200.

Fixes issue where while running you reach the maximum speed while holding the
joystick at only 83% (when joy_exponent_move is at its default value of 3, and
when joy_exponent_move is 2, 75%, and when joy_exponent_move is 1, 57%).
2023-03-11 10:11:01 +03:00
Chris Cowan 4a18467d36 Add joy_outer_threshold_{look,move} CVARs 2023-03-11 10:11:01 +03:00
Chris Cowan dd41c39aa7 split joy_deadzone cvar to _move and _look cvars 2023-03-11 10:11:01 +03:00
Chris Cowan 9d941b2d73 Disable turning with joystick while paused or menu open
Also fixes mouse movements accumulating while paused.

- If you're playing with a controller, you can still turn the player
  while the game is paused or a menu is open. It's pretty jank as you
  may be controlling the faded scene in the background behind a menu,
  and it might make someone think their inputs aren't being read by the
  menu or that the game isn't truly paused.
- If the game is paused (with the pause key specifically, so that the
  mouse is still captured), then mouse movements continue to accumulate
  while you're paused, potentially causing a very sudden disorienting
  jump when the game is eventually unpaused.
- If you're chatting, then you can still look around (with the mouse or
  controller), though you can't move or shoot. This can be confusing if
  you don't realize you're locked in a menu (as every other case you're
  locked in a menu stops you from looking around with the mouse).
2023-03-11 10:11:00 +03:00
Chris Cowan 88d9a8f45d Fix MacOS mouse grabbing issue
Fixes https://github.com/sezero/quakespasm/issues/48 by
centering the mouse on the window prior to grabbing it.
2023-03-11 10:11:00 +03:00
Shpoike 26f0bc4682 Merge remote-tracking branch 'sf/master' into qss
(cl_startdemos stripped in favour of QSS's existing cl_demoreel cvar. osx project files ignored.)
2022-04-27 22:32:40 +01:00
Andrei Drexler 32b1ebb828 Fix mouse input truncation with non-integral sensitivity 2022-03-11 23:55:10 +03:00
Shpoike 8b6737a436 Make menuqc respect qs's scr_menuscale cvar instead of scr_sbarscale. 2021-08-31 04:59:12 +01:00
Shpoike 06fd012dfe Custom hardware cursors, fix missing cursor when running fullscreen. 2021-08-31 04:59:12 +01:00
Shpoike 54538a054a Menuqc support. Only tested against menusys so far. 2021-08-31 04:59:12 +01:00
Spike fef685af82 Don't try doing mouse grabs in dedicated servers... 2021-08-31 04:59:11 +01:00
Shpoike 3e8d514237 Fix some warnings. 2021-08-31 04:59:11 +01:00
Spike fe4b224c7d Added support for simple csqc.
This is a subset of csqc, with alternative entry points that can be invoked by compat wrappers.

Also added sv_gameplayfix_setmodelrealbox cvar. Default value of 1 matches QuakeSpasm, whereas a value of 0 matches vanilla quake's behaviour.
2021-08-31 04:59:11 +01:00
Spike d76ca606bf All changes present in QSS-R7, plus
md3 support
quoth/etc bug fix
strzone bug fix
png/jpg replacement wall textures
rewrote mdl rendering to always use arrays, relaxing vertex+tri limits.
removed static ents limit
fixed ambient_level not working at high framerates.
2021-08-31 04:59:11 +01:00
Eric Wasylishen f910bae881 in_sdl: Change controller movement to use cubic easing by default; added
"joy_exponent_move" cvar.

Previously movement was linear.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1556 af15c1b1-3010-417e-b628-4374ebc0bcbd
2018-02-05 06:37:50 +00:00
Eric Wasylishen 79aac789be Revert "always run" changes from r797; move the QuakeSpasm customizations to a new "cl_alwaysrun" cvar.
Set to 1 to scale forward/side/up speed by "cl_movespeedkey" (usually 2), and make "speedkey" act as "slowkey".

Change "always run" menu option to offer
"off" (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200),
"vanilla" (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400) and
"quakespasm" (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1480 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-23 06:00:20 +00:00
Ozkan Sezer 6c885849d2 in_sdl.c: OW1.9 doesn't have powf() and sqrtf(). use pow/sqrt, instead.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1458 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-29 07:00:50 +00:00
Eric Wasylishen f13af4d0e5 in_sdl.c: raise joy_deadzone_trigger to 0.2.
Previous value of 0.001 was probably too low, may have caused
"stuck" triggers:
http://celephais.net/board/view_thread.php?id=60452&start=2935

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1439 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-27 22:55:08 +00:00
Eric Wasylishen 702b0decf1 in_debugkeys: print time, and log text input mode changes
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1373 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-01-17 22:39:19 +00:00
Ozkan Sezer bc5cc7094a add missing SDLCALL to SDL callback functions (it need not be nothing for every platform.)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1367 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-12-17 12:10:07 +00:00
Eric Wasylishen 7897f0700e in_sdl.c: make new joy_* cvars CVAR_ARCHIVE
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1322 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-26 23:37:41 +00:00
Ozkan Sezer f07ac29c0b fix C++11 -Wliteral-suffix warnings. fix -Wnarrowing errors/warnings.
fix the detestable in_sdl.c/SDL2 int-to-enum conversion failure errors
from g++.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1302 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-04-29 20:00:50 +00:00
Eric Wasylishen 39a6b46713 in_sdl.c: lower default controller deadzone to 0.175. refactor a bit, fix clamping of look axis vector length.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1297 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-09 04:42:44 +00:00
Eric Wasylishen f8ccd07420 in_sdl.c: IN_StartupJoystick: do SDL_INIT_GAMECONTROLLER before SDL_GameControllerAddMappingsFromFile, to match the sdl testgamecontroller tool
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1296 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-03 23:01:44 +00:00
Eric Wasylishen dfcaa52260 in_sdl.c: improve error messages when opening joysticks
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1295 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-03 21:38:58 +00:00
Eric Wasylishen e007e35e6d in_sdl.c: fix spurious "-1 mappings loaded from gamecontrollerdb.txt" message
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1294 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-02 00:04:25 +00:00
Eric Wasylishen dc2218b9c8 SDL2 Game Controller support
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1293 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-01 21:58:08 +00:00
Eric Wasylishen f607f1b4eb in_sdl: change DBEUG_INPUT preprocessor check to an "in_debugkeys" cvar to make it easier to debug unusual keyboards
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1114 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 18:31:49 +00:00
Sander van Dijk 13cfd00787 input: Remove some of stuff obsoleted by r1110.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1112 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 17:10:34 +00:00
Eric Wasylishen 3cb6f871f1 in_sdl.c: make key debug logging more verbose
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1111 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 04:03:16 +00:00
Eric Wasylishen 1b6abd0e04 in_sdl.c, key.c: Fixes agreed on with Sander:
1. Remove Key_IgnoreTextInput(), and simple always send a Char_Event when
we receive TEXTINPUT (SDL2) or the unicode field of a KEYDOWN event is
filled (SDL1.).
2. Remove handling of K_KP_* in the menu/console, since they cannot be
relied on to not also send text (see issue described above). The handling
of K_KP_ENTER can stay, since we do know that it never sends text.
3. Remove the interpretation hack for the numpad, since it will no longer
be needed (and doesn't currently work for SDL2 anyway); if a numpad key
generates text we will handle it (because of "1"), if not then it will
simply be if ignored (because of "2”).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1110 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 03:30:44 +00:00
Eric Wasylishen aeb4ed86d2 in_sdl: remove lastKeyDown hack
was no longer needed and was causing issues typing underscores (US keyboard layout) on Linux/SDL2 where SDL_TEXTINPUT is delivered before the SDL_KEYDOWN.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1109 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-13 03:21:47 +00:00
Eric Wasylishen bd07399747 in_sdl: add some debug logging for key events (only if DEBUG_INPUT is defined)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1108 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-13 03:21:40 +00:00
Ozkan Sezer 039fdaad6f minor whitespace adjustments
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1101 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-11 19:11:40 +00:00
Sander van Dijk 1440636ec6 input: Move fullscreen and console toggle from in_sdl.c to keys.c.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1096 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-11 08:49:45 +00:00
Sander van Dijk 42c708a1e1 in_sdl.c: rewrite TEXTINPUT handling a bit again.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1094 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-08 20:03:05 +00:00
Sander van Dijk db68976877 in_sdl: Remove commented-out m_filter code and a misleading comment.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1093 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-08 18:57:55 +00:00
Sander van Dijk c23a0197d6 Rename some (recently added) functions.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1092 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-08 18:30:17 +00:00
Sander van Dijk 5e73eb18a4 in_sdl.c: Workaround for broken SDL2 numlock state.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1091 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-07 06:15:16 +00:00
Sander van Dijk eaa33b20b6 in_sdl.c: Fix numpad translation with SDL 1.2.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1090 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-06 20:47:35 +00:00
Sander van Dijk 745c643ef2 input: Some more tuning.
* in_sdl.c: Remove the over-zealous "no events for unknown keys" checks introduced in r1085. Events for unknown keys can be useful for "press any key" situations.
* keys.c: In input grab mode, update the "lastkey" member only for key down events.
* keys.c/console.c: Adapt input grab mode to properly support catching "any key" presses.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1089 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-06 06:09:42 +00:00
Sander van Dijk 045cf968de in_sdl.c: Inline IN_IsNumpadKey().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1088 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 21:02:25 +00:00
Sander van Dijk 5ca58d55b0 input: Minor tuning.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1086 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 19:03:48 +00:00
Sander van Dijk 14f5275a2c input: Implement numpad translation in text input mode.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1085 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 18:21:58 +00:00