diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-08-23 20:48:39 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-08-23 20:48:39 +0000 |
| commit | 1e052267fb32e68328c769bfde987bd382829dd5 (patch) | |
| tree | 82cb7279c869321209563ce70119ce642629c4e1 /macosx/plugins/DFInput/macsrc/xkb.c | |
| parent | 47d52dacd0e12e909bf91c9bd99478e6b90dbfec (diff) | |
| download | pcsxr-1e052267fb32e68328c769bfde987bd382829dd5.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@69887 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFInput/macsrc/xkb.c')
| -rw-r--r-- | macosx/plugins/DFInput/macsrc/xkb.c | 17 |
1 files changed, 16 insertions, 1 deletions
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; |
