Use BIT_CLEAR/BIT_SET for android_input.c
This commit is contained in:
parent
ea0d572ef1
commit
1d7dea392d
|
@ -219,6 +219,7 @@ static inline void android_input_poll_event_type_key(
|
||||||
AInputEvent *event, int port, int keycode, int source,
|
AInputEvent *event, int port, int keycode, int source,
|
||||||
int type_event, int *handled)
|
int type_event, int *handled)
|
||||||
{
|
{
|
||||||
|
uint8_t *buf = android->pad_state[port];
|
||||||
int action = AKeyEvent_getAction(event);
|
int action = AKeyEvent_getAction(event);
|
||||||
|
|
||||||
/* some controllers send both the up and down events at once
|
/* some controllers send both the up and down events at once
|
||||||
|
@ -227,9 +228,9 @@ static inline void android_input_poll_event_type_key(
|
||||||
* cleared every poll anyway)
|
* cleared every poll anyway)
|
||||||
*/
|
*/
|
||||||
if (action == AKEY_EVENT_ACTION_UP)
|
if (action == AKEY_EVENT_ACTION_UP)
|
||||||
clear_bit(android->pad_state[port], keycode);
|
BIT_CLEAR(buf, keycode);
|
||||||
else if (action == AKEY_EVENT_ACTION_DOWN)
|
else if (action == AKEY_EVENT_ACTION_DOWN)
|
||||||
set_bit(android->pad_state[port], keycode);
|
BIT_SET(buf, keycode);
|
||||||
|
|
||||||
if ((keycode == AKEYCODE_VOLUME_UP || keycode == AKEYCODE_VOLUME_DOWN))
|
if ((keycode == AKEYCODE_VOLUME_UP || keycode == AKEYCODE_VOLUME_DOWN))
|
||||||
*handled = 0;
|
*handled = 0;
|
||||||
|
|
Loading…
Reference in New Issue