Move clear_bit/get_bit/set_bit to input_common.h
This commit is contained in:
parent
9edb88caba
commit
8b309fbeaa
|
@ -100,21 +100,6 @@ static typeof(AMotionEvent_getAxisValue) *p_AMotionEvent_getAxisValue;
|
||||||
|
|
||||||
#define AMotionEvent_getAxisValue (*p_AMotionEvent_getAxisValue)
|
#define AMotionEvent_getAxisValue (*p_AMotionEvent_getAxisValue)
|
||||||
|
|
||||||
static inline bool get_bit(const uint8_t *buf, unsigned bit)
|
|
||||||
{
|
|
||||||
return buf[bit >> 3] & (1 << (bit & 7));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void clear_bit(uint8_t *buf, unsigned bit)
|
|
||||||
{
|
|
||||||
buf[bit >> 3] &= ~(1 << (bit & 7));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void set_bit(uint8_t *buf, unsigned bit)
|
|
||||||
{
|
|
||||||
buf[bit >> 3] |= 1 << (bit & 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void engine_handle_dpad_default(android_input_t *android,
|
static void engine_handle_dpad_default(android_input_t *android,
|
||||||
AInputEvent *event, int port, int source)
|
AInputEvent *event, int port, int source)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,6 +54,21 @@ static inline void input_conv_analog_id_to_bind_id(unsigned index, unsigned id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool get_bit(const uint8_t *buf, unsigned bit)
|
||||||
|
{
|
||||||
|
return buf[bit >> 3] & (1 << (bit & 7));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void clear_bit(uint8_t *buf, unsigned bit)
|
||||||
|
{
|
||||||
|
buf[bit >> 3] &= ~(1 << (bit & 7));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void set_bit(uint8_t *buf, unsigned bit)
|
||||||
|
{
|
||||||
|
buf[bit >> 3] |= 1 << (bit & 7);
|
||||||
|
}
|
||||||
|
|
||||||
bool input_translate_coord_viewport(int mouse_x, int mouse_y,
|
bool input_translate_coord_viewport(int mouse_x, int mouse_y,
|
||||||
int16_t *res_x, int16_t *res_y, int16_t *res_screen_x,
|
int16_t *res_x, int16_t *res_y, int16_t *res_screen_x,
|
||||||
int16_t *res_screen_y);
|
int16_t *res_screen_y);
|
||||||
|
|
|
@ -101,21 +101,6 @@ struct udev_input
|
||||||
bool mouse_l, mouse_r, mouse_m, mouse_wu, mouse_wd;
|
bool mouse_l, mouse_r, mouse_m, mouse_wu, mouse_wd;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline bool get_bit(const uint8_t *buf, unsigned bit)
|
|
||||||
{
|
|
||||||
return buf[bit >> 3] & (1 << (bit & 7));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void clear_bit(uint8_t *buf, unsigned bit)
|
|
||||||
{
|
|
||||||
buf[bit >> 3] &= ~(1 << (bit & 7));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void set_bit(uint8_t *buf, unsigned bit)
|
|
||||||
{
|
|
||||||
buf[bit >> 3] |= 1 << (bit & 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_XKBCOMMON
|
#ifdef HAVE_XKBCOMMON
|
||||||
// FIXME: Don't handle composed and dead-keys properly. Waiting for support in libxkbcommon ...
|
// FIXME: Don't handle composed and dead-keys properly. Waiting for support in libxkbcommon ...
|
||||||
static void handle_xkb(udev_input_t *udev, int code, int value)
|
static void handle_xkb(udev_input_t *udev, int code, int value)
|
||||||
|
|
Loading…
Reference in New Issue