Skip to content

Commit

Permalink
Merge branch 'ioquake:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
capehill authored Oct 28, 2022
2 parents d61d478 + 84da653 commit bff474e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
7 changes: 7 additions & 0 deletions code/client/cl_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ keyname_t keynames[] =
{"PAD0_LEFTTRIGGER", K_PAD0_LEFTTRIGGER },
{"PAD0_RIGHTTRIGGER", K_PAD0_RIGHTTRIGGER },

{"PAD0_MISC1", K_PAD0_MISC1 },
{"PAD0_PADDLE1", K_PAD0_PADDLE1 },
{"PAD0_PADDLE2", K_PAD0_PADDLE2 },
{"PAD0_PADDLE3", K_PAD0_PADDLE3 },
{"PAD0_PADDLE4", K_PAD0_PADDLE4 },
{"PAD0_TOUCHPAD", K_PAD0_TOUCHPAD },

{NULL,0}
};

Expand Down
7 changes: 7 additions & 0 deletions code/client/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ typedef enum {
K_PAD0_LEFTTRIGGER,
K_PAD0_RIGHTTRIGGER,

K_PAD0_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
K_PAD0_PADDLE1, /* Xbox Elite paddle P1 */
K_PAD0_PADDLE2, /* Xbox Elite paddle P3 */
K_PAD0_PADDLE3, /* Xbox Elite paddle P2 */
K_PAD0_PADDLE4, /* Xbox Elite paddle P4 */
K_PAD0_TOUCHPAD, /* PS4/PS5 touchpad button */

// Pseudo-key that brings the console down
K_CONSOLE,

Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/vm_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#endif

#if defined (__i386__) || defined(__x86_64__)
#if defined (__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)
static void VM_Destroy_Compiled(vm_t* self);

/*
Expand Down
14 changes: 12 additions & 2 deletions code/sdl/sdl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,10 @@ static void IN_InitJoystick( void )
Q_strcat(buf, sizeof(buf), "\n");
}

Cvar_Get( "in_availableJoysticks", buf, CVAR_ROM );
Cvar_Get( "in_availableJoysticks", "", CVAR_ROM );

// Update cvar on in_restart or controller add/remove.
Cvar_Set( "in_availableJoysticks", buf );

if( !in_joystick->integer ) {
Com_DPrintf( "Joystick is not active.\n" );
Expand Down Expand Up @@ -657,7 +660,14 @@ static void IN_GamepadMove( void )
qboolean pressed = SDL_GameControllerGetButton(gamepad, SDL_CONTROLLER_BUTTON_A + i);
if (pressed != stick_state.buttons[i])
{
Com_QueueEvent(in_eventTime, SE_KEY, K_PAD0_A + i, pressed, 0, NULL);
#if SDL_VERSION_ATLEAST( 2, 0, 14 )
if ( i >= SDL_CONTROLLER_BUTTON_MISC1 ) {
Com_QueueEvent(in_eventTime, SE_KEY, K_PAD0_MISC1 + i - SDL_CONTROLLER_BUTTON_MISC1, pressed, 0, NULL);
} else
#endif
{
Com_QueueEvent(in_eventTime, SE_KEY, K_PAD0_A + i, pressed, 0, NULL);
}
stick_state.buttons[i] = pressed;
}
}
Expand Down

0 comments on commit bff474e

Please sign in to comment.