2 * Copyright (C) Prikol Software 1996-1997
3 * Copyright (C) Aleksey Volynskov 1996-1997
4 * Copyright (C) <ARembo@gmail.com> 2011
5 * Copyright (C) fgsfds 2019
7 * This file is part of the Doom2D PSX project.
9 * Doom2D PSX is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * Doom2D PSX is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/> or
20 * write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 unsigned int pad_btns
= 0;
31 unsigned int pad_trig
= 0;
33 static key_f
* key_proc
= NULL
;
35 const char *K_name(int k
) {
36 static const char *knames
[16] = {
55 for (i
= 0; i
< 32; ++i
)
57 return knames
[i
& 0xF];
68 // установить функцию обработки клавиш
69 void K_setkeyproc(key_f
* k
) {
74 unsigned int pad
= PadRead(0);
75 pad_trig
= pad
& (pad
^ pad_btns
);
78 if (key_proc
&& pad_btns
!= pad
) {
79 unsigned int i
, n
, new;
81 for (n
= 0; n
< 32; ++n
, i
<<= 1) {
83 if (new != (pad_btns
& i
))