|
|
452870 |
#ifndef INPUT_H
|
|
|
452870 |
#define INPUT_H
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
#include "common.h"
|
|
|
452870 |
|
|
|
452870 |
|
|
|
843e7a |
#define IN_MAXKEYS 256
|
|
|
843e7a |
|
|
|
843e7a |
enum {
|
|
|
843e7a |
IM_SHIFT,
|
|
|
843e7a |
IM_CAPSLOCK,
|
|
|
843e7a |
IM_SHIFTLOCK,
|
|
|
843e7a |
IM_NUMLOCK,
|
|
|
843e7a |
IM_GROUP,
|
|
|
569832 |
IM_SCRLOCK,
|
|
|
843e7a |
IM_COUNT };
|
|
|
843e7a |
|
|
|
63daec |
enum {
|
|
|
63daec |
IM_SHIFT_BIT = 1 << IM_SHIFT,
|
|
|
63daec |
IM_CAPSLOCK_BIT = 1 << IM_CAPSLOCK,
|
|
|
63daec |
IM_SHIFTLOCK_BIT = 1 << IM_SHIFTLOCK,
|
|
|
63daec |
IM_NUMLOCK_BIT = 1 << IM_NUMLOCK,
|
|
|
569832 |
IM_GROUP_BIT = 1 << IM_GROUP,
|
|
|
569832 |
IM_SCRLOCK_BIT = 1 << IM_SCRLOCK };
|
|
|
63daec |
|
|
|
843e7a |
|
|
|
452870 |
typedef struct Input {
|
|
|
452870 |
App *app;
|
|
|
843e7a |
int key0, key1;
|
|
|
843e7a |
unsigned int keys[IN_MAXKEYS][1 << IM_COUNT];
|
|
|
843e7a |
unsigned int masks[IM_COUNT];
|
|
|
843e7a |
|
|
|
843e7a |
int mapKey;
|
|
|
843e7a |
int mapDown;
|
|
|
63daec |
unsigned int modifiers;
|
|
|
452870 |
} Input;
|
|
|
452870 |
|
|
|
452870 |
|
|
|
63daec |
void inputPrepareKeysyms(unsigned int *ks0, unsigned int *ks1, int *isLetter, int *isKeypad);
|
|
|
63daec |
int inputChooseKeysym(unsigned int modifiers, unsigned int ks0, unsigned int ks1, int isLetter, int isKeypad);
|
|
|
63daec |
|
|
|
452870 |
int inputInit(Input *in, App *app);
|
|
|
452870 |
void inputDeinit(Input *in);
|
|
|
8864eb |
void inputUpdateLayout(Input *in, int key0, int key1);
|
|
|
63daec |
void inputUpdateModifiers(Input *in);
|
|
|
843e7a |
int inputKeycode(Input *in, unsigned int keySym);
|
|
|
843e7a |
void inputEvent(Input *in, int keycode, int press);
|
|
|
452870 |
|
|
|
452870 |
|
|
|
63daec |
|
|
|
452870 |
#endif
|