Skip to content

Commit

Permalink
2.70-RC1
Browse files Browse the repository at this point in the history
Fix touch handler responsive.
Reduce fling touch move history
  • Loading branch information
Ahmad Amarullah committed Aug 13, 2013
1 parent 36a7bf0 commit 3fdff38
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
Binary file removed assets/META-INF/com/google/android/update-binary
Binary file not shown.
2 changes: 1 addition & 1 deletion src/aroma.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ byte file_exists(const char * file);
//
// AROMA Kinetic Library Structures
//
#define AKINETIC_HISTORY_LENGTH 10
#define AKINETIC_HISTORY_LENGTH 4
#define AKINETIC_DAMPERING 0.98 // Gravity
typedef struct {
byte isdown; // Is Touch Down
Expand Down
2 changes: 1 addition & 1 deletion src/controls/aroma_controls.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ byte aw_setfocus(AWINDOWP win, ACONTROLP ctl) {
dword aw_dispatch(AWINDOWP win) {
dword msg;
int i;
ui_clear_key_queue();
// ui_clear_key_queue();

while (1) {
//-- Wait For Event
Expand Down
33 changes: 23 additions & 10 deletions src/libs/aroma_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ void ev_input_callback_(struct input_event * ev) {
}
}

byte touch_move_sent = 0;
//-- INPUT THREAD
static void * ev_input_thread(void * cookie) {
//-- Loop for Input
Expand All @@ -207,15 +208,17 @@ static void * ev_input_thread(void * cookie) {
if (ret == AINPUT_EV_RET_TOUCH) {
if ((e.x > 0) && (e.y > 0)) {
if (e.state == 2) {
int dx = abs(evtouch_x - e.x);
int dy = abs(evtouch_y - e.y);
evtouch_x = e.x;
evtouch_y = e.y;
evtouch_state = e.state;

if (dx + dy > 0) {
evtouch_x = e.x;
evtouch_y = e.y;
evtouch_state = e.state;
if (touch_move_sent == 0) {
touch_move_sent = 1;
ev_post_message(evtouch_code, evtouch_state);
}
else {
touch_move_sent = 2;
}
}
else {
evtouch_x = e.x;
Expand Down Expand Up @@ -288,13 +291,23 @@ void ui_clear_key_queue() {
//-- Wait For Key
int ui_wait_key() {
pthread_mutex_lock(&key_queue_mutex);
int key = 0;

while (key_queue_len == 0) {
pthread_cond_wait(&key_queue_cond, &key_queue_mutex);
if (touch_move_sent == 2) {
touch_move_sent = 1;
key = evtouch_code;
}
else {
touch_move_sent = 0;

while (key_queue_len == 0) {
pthread_cond_wait(&key_queue_cond, &key_queue_mutex);
}

key = key_queue[0];
memcpy(&key_queue[0], &key_queue[1], sizeof(int) * --key_queue_len);
}

int key = key_queue[0];
memcpy(&key_queue[0], &key_queue[1], sizeof(int) * --key_queue_len);
pthread_mutex_unlock(&key_queue_mutex);
return key;
}
Expand Down

0 comments on commit 3fdff38

Please sign in to comment.