- 精华
- 0
- 帖子
- 812
- 威望
- 0 点
- 积分
- 820 点
- 种子
- 0 点
- 注册时间
- 2007-1-29
- 最后登录
- 2014-12-15
|
楼主 |
发表于 2010-12-10 18:59 · 香港
|
显示全部楼层
gjhuy 发表于 2010-12-10 18:53
还有问一下0x3B是手柄的哪个键? - if (ps3_menuinput->UpdateDevice(0) == CELL_PAD_OK)
- {
- switch (nCode)
- {
- case 0x06:
- return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_SELECT)) ? 1 : 0);
- case 0x02:
- return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_START)) ? 1 : 0);
- case 0xC8: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_UP) | ps3_menuinput->IsAnalogPressedUp(0, PS3_BUTTON_LSTICK)) ? 1 : 0); // Up
- case 0xD0: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_DOWN) | ps3_menuinput->IsAnalogPressedDown(0, PS3_BUTTON_LSTICK)) ? 1 : 0); // Down
- case 0xCB: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_LEFT) | ps3_menuinput->IsAnalogPressedLeft(0, PS3_BUTTON_LSTICK)) ? 1 : 0); // Left
- case 0xCD: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_RIGHT)| ps3_menuinput->IsAnalogPressedRight(0, PS3_BUTTON_LSTICK))? 1 : 0); // Right
- case 0x2C: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_CROSS)) ? 1 : 0); // fire 1
- case 0x2D: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_CIRCLE)) ? 1 : 0); // fire 2
- case 0x2E: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_SQUARE)) ? 1 : 0); // fire 3
- case 0x2F: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_TRIANGLE)) ? 1 : 0); // fire 4
- case 0x1F: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_L1)) ? 1 : 0); // fire 5
- case 0x20: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_R1)) ? 1 : 0); // fire 6
- case 0x88:
- return ( (ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_L2)) ? 1 : 0);
- case 0x8A:
- return ( (ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_R2)) ? 1 : 0);
- case 0x3b:
- return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_L3)) ? 1 : 0);
- case 0x3c:
- return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_R3)) ? 1 : 0);
-
- case 0x21: return ((ps3_menuinput->IsButtonPressed(0,PS3_BUTTON_R2)) ? 1 : 0);
- }
- }
- if (ps3_menuinput->UpdateDevice(1) == CELL_PAD_OK)
- {
- switch (nCode)
- {
- case 0x07:
- return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_SELECT)) ? 1 : 0);
- case 0x03:
- return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_START)) ? 1 : 0);
- case 0x4002: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_UP) | ps3_menuinput->IsAnalogPressedUp(1, PS3_BUTTON_LSTICK)) ? 1 : 0); // Up
- case 0x4003: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_DOWN) | ps3_menuinput->IsAnalogPressedDown(1, PS3_BUTTON_LSTICK)) ? 1 : 0); // Down
- case 0x4000: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_LEFT) | ps3_menuinput->IsAnalogPressedLeft(1, PS3_BUTTON_LSTICK)) ? 1 : 0); // Left
- case 0x4001: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_RIGHT)| ps3_menuinput->IsAnalogPressedRight(1, PS3_BUTTON_LSTICK))? 1 : 0); // Right
- case 0x4080: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_CROSS)) ? 1 : 0); // fire 1
- case 0x4081: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_CIRCLE)) ? 1 : 0); // fire 2
- case 0x4082: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_SQUARE)) ? 1 : 0); // fire 3
- case 0x4083: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_TRIANGLE)) ? 1 : 0); // fire 4
- case 0x4084: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_L1)) ? 1 : 0); // fire 5
- case 0x4085: return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_R1)) ? 1 : 0); // fire 6
- case 0x4088:
- return ( (ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_L2)) ? 1 : 0);
- case 0x408A:
- return ( (ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_R2)) ? 1 : 0);
- case 0x403b:
- return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_L3)) ? 1 : 0);
- case 0x403c:
- return ((ps3_menuinput->IsButtonPressed(1,PS3_BUTTON_R3)) ? 1 : 0);
- }
- }
- if (ps3_menuinput->UpdateDevice(2) == CELL_PAD_OK)
- {
- switch (nCode)
- {
- case 0x08:
- return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_SELECT)) ? 1 : 0);
- case 0x04:
- return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_START)) ? 1 : 0);
- case 0x4102: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_UP) | ps3_menuinput->IsAnalogPressedUp(2, PS3_BUTTON_LSTICK)) ? 1 : 0); // Up
- case 0x4103: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_DOWN) | ps3_menuinput->IsAnalogPressedDown(2, PS3_BUTTON_LSTICK)) ? 1 : 0); // Down
- case 0x4100: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_LEFT) | ps3_menuinput->IsAnalogPressedLeft(2, PS3_BUTTON_LSTICK)) ? 1 : 0); // Left
- case 0x4101: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_RIGHT)| ps3_menuinput->IsAnalogPressedRight(2, PS3_BUTTON_LSTICK)) ? 1 : 0); // Right
- case 0x4180: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_CROSS)) ? 1 : 0); // fire 1
- case 0x4181: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_CIRCLE)) ? 1 : 0); // fire 2
- case 0x4182: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_SQUARE)) ? 1 : 0); // fire 3
- case 0x4183: return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_TRIANGLE)) ? 1 : 0); // fire 4
- case 0x4184: return ((ps3_menuinput->WasButtonPressed(2,PS3_BUTTON_L1)) ? 1 : 0); // fire 5
- case 0x4185: return ((ps3_menuinput->WasButtonPressed(2,PS3_BUTTON_R1)) ? 1 : 0); // fire 6
- case 0x4188:
- return ( (ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_L2)) ? 1 : 0);
- case 0x418A:
- return ( (ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_R2)) ? 1 : 0);
- case 0x413b:
- return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_L3)) ? 1 : 0);
- case 0x413c:
- return ((ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_R3)) ? 1 : 0);
- }
- }
- if (ps3_menuinput->UpdateDevice(3) == CELL_PAD_OK)
- {
- switch (nCode)
- {
- case 0x09:
- return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_SELECT)) ? 1 : 0);
- case 0x05:
- return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_START)) ? 1 : 0);
- case 0x4202: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_UP) | ps3_menuinput->IsAnalogPressedUp(3, PS3_BUTTON_LSTICK)) ? 1 : 0); // Up
- case 0x4203: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_DOWN) | ps3_menuinput->IsAnalogPressedDown(3, PS3_BUTTON_LSTICK)) ? 1 : 0); // Down
- case 0x4200: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_LEFT) | ps3_menuinput->IsAnalogPressedLeft(3, PS3_BUTTON_LSTICK)) ? 1 : 0); // Left
- case 0x4201: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_RIGHT)| ps3_menuinput->IsAnalogPressedRight(3, PS3_BUTTON_LSTICK))? 1 : 0); // Right
- case 0x4280: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_CROSS)) ? 1 : 0); // fire 1
- case 0x4281: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_CIRCLE)) ? 1 : 0); // fire 2
- case 0x4282: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_SQUARE)) ? 1 : 0); // fire 3
- case 0x4283: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_TRIANGLE)) ? 1 : 0); // fire 4
- case 0x4284: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_L1)) ? 1 : 0); // fire 5
- case 0x4285: return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_R1)) ? 1 : 0); // fire 6
- case 0x4288:
- return ( (ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_L2)) ? 1 : 0);
- case 0x428A:
- return ( (ps3_menuinput->IsButtonPressed(2,PS3_BUTTON_R2)) ? 1 : 0);
- case 0x423b:
- return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_L3)) ? 1 : 0);
- case 0x423c:
- return ((ps3_menuinput->IsButtonPressed(3,PS3_BUTTON_R3)) ? 1 : 0);
- }
- }
-
- return 0;
- }
复制代码 |
|