|
|
452870 |
#ifndef INPUT_H
|
|
|
452870 |
#define INPUT_H
|
|
|
452870 |
|
|
|
452870 |
|
|
|
452870 |
#include "common.h"
|
|
|
452870 |
|
|
|
452870 |
#include <x11 xlib.h=""></x11>
|
|
|
452870 |
#include <x11 keysym.h=""></x11>
|
|
|
452870 |
#include <x11 keysymdef.h=""></x11>
|
|
|
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;
|
|
|
452870 |
Display *dpy;
|
|
|
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;
|
|
|
843e7a |
int updated;
|
|
|
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);
|
|
|
843e7a |
void inputUpdateLayout(Input *in);
|
|
|
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
|