From 6906e1b0e3ab94aedf126f336b81388f44380c0a Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 23 Jul 2009 05:06:38 +0000 Subject: [PATCH] - Added default bindings for the Xbox 360 controller buttons. (Still to do: Make the menus work with a controller.) SVN r1732 (trunk) --- docs/rh-log.txt | 1 + src/c_bind.cpp | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 0fe1b8757..7c7599eb5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ July 22, 2009 +- Added default bindings for the Xbox 360 controller buttons. - Fixed: Redefining an existing skill would set that skills ACSReturn to be the same as the next new skill defined, if neither definition explicitly set the value for ACSReturn. diff --git a/src/c_bind.cpp b/src/c_bind.cpp index ff69f2f86..f7450aaa5 100644 --- a/src/c_bind.cpp +++ b/src/c_bind.cpp @@ -89,10 +89,6 @@ static const FBinding DefBindings[] = { "mouse2", "+strafe" }, { "mouse3", "+forward" }, { "mouse4", "+speed" }, - { "joy1", "+attack" }, - { "joy2", "+strafe" }, - { "joy3", "+speed" }, - { "joy4", "+use" }, { "capslock", "toggle cl_run" }, { "f1", "menu_help" }, { "f2", "menu_save" }, @@ -113,6 +109,27 @@ static const FBinding DefBindings[] = { "f12", "spynext" }, { "mwheeldown", "weapnext" }, { "mwheelup", "weapprev" }, + + // Generic joystick buttons + { "joy1", "+attack" }, + { "joy2", "+strafe" }, + { "joy3", "+speed" }, + { "joy4", "+use" }, + + // Xbox 360 / PS2 controllers + { "pad_a", "+use" }, + { "pad_y", "+jump" }, + { "rtrigger", "+attack" }, + { "ltrigger", "+altattack" }, + { "lshoulder", "weapprev" }, + { "rshoulder", "weapnext" }, + { "dpadleft", "invprev" }, + { "dpadright", "invnext" }, + { "dpaddown", "invuse" }, + { "dpadup", "togglemap" }, + { "pad_start", "pause" }, + { "pad_back", "menu_main" }, + { "lthumb", "crouch" }, { NULL } };