LilyPad: Minor fixes to alt-F4 detection code.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2001 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
MattMenke 2009-10-13 02:35:25 +00:00
parent c5c21f06cb
commit 22d31831e6
3 changed files with 11 additions and 4 deletions

View File

@ -161,14 +161,16 @@ void Device::CalcVirtualState() {
if (!(virtualControlState[index]>>15) != !(oldVirtualControlState[index]>>15) && c->vkey) {
// Check for alt-F4 to avoid toggling skip mode incorrectly.
if (c->vkey == VK_F4) {
for (int i=0; i<numPhysicalControls; i++) {
int i;
for (i=0; i<numPhysicalControls; i++) {
if (virtualControlState[physicalControls[i].baseVirtualControlIndex] &&
(physicalControls[i].vkey == VK_MENU ||
physicalControls[i].vkey == VK_RMENU ||
physicalControls[i].vkey == VK_LMENU)) {
return;
break;
}
}
if (i<numPhysicalControls) continue;
}
int event = KEYPRESS;
if (!(virtualControlState[index]>>15)) event = KEYRELEASE;

View File

@ -15,7 +15,9 @@
* Still more effort than it's worth to port to Linux, however.
*/
// Match DirectInput8 values.
// Mostly match DirectInput8 values. Note that these are for physical controls.
// One physical axis maps to 3 virtual ones, and one physical POV control maps to
// 4 virtual ones.
enum ControlType {
NO_CONTROL = 0,
// Axes are ints. Relative axes are for mice, mice wheels, etc,
@ -35,6 +37,9 @@ enum ControlType {
// that range is treated as -1 (Though 36000-37000 is treated
// like 0 to 1000, just in case).
POV = 16,
// Pressure sensitive buttons. Only a different type because
// they have configurable dead zones, unlike push or toggle buttons.
PRESSURE_BTN = 32,
};

View File

@ -25,7 +25,7 @@ void WindowsKeyboard::UpdateKey(int vkey, int state) {
int newState = state * FULLY_DOWN;
if (newState != physicalControlState[vkey]) {
// Check for alt-F4 to avoid toggling skip mode incorrectly.
if (vkey != VK_F4 || !(physicalControls[VK_MENU].vkey || physicalControls[VK_MENU].vkey || physicalControls[VK_MENU].vkey)) {
if (vkey != VK_F4 || !(physicalControlState[VK_MENU] || physicalControlState[VK_RMENU] || physicalControlState[VK_LMENU])) {
int event = KEYPRESS;
if (!newState) event = KEYRELEASE;
QueueKeyEvent(vkey, event);