2 * Copyright (c) 2010, Wei Mingzhi <whistler@openoffice.org>.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses>.
22 g.PadState[0].KeyStatus = 0xFFFF;
23 g.PadState[1].KeyStatus = 0xFFFF;
26 void DestroyKeyboard() {
29 void CheckKeyboard() {
38 g.PadState[0].KeyStatus = 0xFFFF;
39 g.PadState[1].KeyStatus = 0xFFFF;
44 (keyState.k[((X) - 1) >> 3] & (1 << (((X) - 1) & 7)))
46 for (i = 0; i < 2; i++) {
47 for (j = 0; j < DKEY_TOTAL; j++) {
48 key = g.cfg.PadDef[i].KeyDef[j].Key;
49 if (key == 0) continue;
51 if (KeyDown(key)) g.PadState[i].KeyStatus &= ~(1 << j);
54 if (g.cfg.PadDef[i].Type != PSE_PAD_TYPE_ANALOGPAD) continue;
56 for (j = 0; j < ANALOG_TOTAL; j++) {
57 for (k = 0; k < 4; k++) {
58 key = g.cfg.PadDef[i].AnalogDef[j][k].Key;
59 if (key == 0) continue;
61 g.PadState[i].AnalogKeyStatus[j][k] = (KeyDown(key) ? 1 : 0);