libwwcl libwwcl
WWitch compatibility layer for the Wonderful toolchain
Loading...
Searching...
No Matches
key.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Adrian "asie" Siekierka
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 *
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 *
20 * 3. This notice may not be removed or altered from any source distribution.
21 */
22
27#ifndef __WF_LIBWW_KEY_H__
28#define __WF_LIBWW_KEY_H__
29
30#include "types.h"
31
37#define KEY_Y4 0x0800
38#define KEY_Y3 0x0400
39#define KEY_Y2 0x0200
40#define KEY_Y1 0x0100
41#define KEY_X4 0x0080
42#define KEY_X3 0x0040
43#define KEY_X2 0x0020
44#define KEY_X1 0x0010
45#define KEY_B 0x0008
46#define KEY_A 0x0004
47#define KEY_START 0x0002
48
49#define KEY_UP1 KEY_X1
50#define KEY_RIGHT1 KEY_X2
51#define KEY_DOWN1 KEY_X3
52#define KEY_LEFT1 KEY_X4
53#define KEY_UP2 KEY_Y1
54#define KEY_RIGHT2 KEY_Y2
55#define KEY_DOWN2 KEY_Y3
56#define KEY_LEFT2 KEY_Y4
57
58uint16_t key_press_check(void);
59uint16_t key_hit_check(void);
60uint16_t key_wait(void);
61void key_set_repeat(uint8_t rate, uint8_t delay);
62// Missing: key_get_repeat
64
67#endif /* __WF_LIBW_KEY_H__ */
void key_set_repeat(uint8_t rate, uint8_t delay)
uint16_t key_press_check(void)
uint16_t key_hit_check_with_repeat(void)
uint16_t key_wait(void)
uint16_t key_hit_check(void)