From 1e052267fb32e68328c769bfde987bd382829dd5 Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Tue, 23 Aug 2011 20:48:39 +0000 Subject: git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@69887 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/DFInput/macsrc/xkb.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'macosx/plugins/DFInput/macsrc/xkb.c') diff --git a/macosx/plugins/DFInput/macsrc/xkb.c b/macosx/plugins/DFInput/macsrc/xkb.c index e9345c2b..c5cfcaf2 100644 --- a/macosx/plugins/DFInput/macsrc/xkb.c +++ b/macosx/plugins/DFInput/macsrc/xkb.c @@ -26,6 +26,20 @@ void InitKeyboard() { void DestroyKeyboard() { } +static void bdown(int pad, int bit) +{ + if(bit < 16) + g.PadState[pad].KeyStatus &= ~(1 << bit); + else if(bit == DKEY_ANALOG) + g.PadState[pad].PadModeSwitch = 1; +} + +static void bup(int pad, int bit) +{ + if(bit < 16) + g.PadState[pad].KeyStatus |= (1 << bit); +} + void CheckKeyboard() { int i, j, k; uint16_t key; @@ -48,7 +62,8 @@ void CheckKeyboard() { key = g.cfg.PadDef[i].KeyDef[j].Key; if (key == 0) continue; - if (KeyDown(key)) g.PadState[i].KeyStatus &= ~(1 << j); + if (KeyDown(key)) bdown(i, j); + else bup(i, j); } if (g.cfg.PadDef[i].Type != PSE_PAD_TYPE_ANALOGPAD) continue; -- cgit v1.2.3