Changeset 4617


Ignore:
Timestamp:
09/01/08 20:09:40 (5 years ago)
Author:
mickey
Message:

neod: Be more relax in keycode used for detecting activity on touch screen.

Different drivers may report different key code. We don't really
need to care which keycode is used, just if there was a key press
at all. So use a range test to look for any 'tool' like button press.

Signed-off-by: NeilBrown? <neilb@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/daemons/neod/src/buttonactions.c

    r4471 r4617  
    5050    #define AUX_BUTTON_KEYCODE 169    /* aux */ 
    5151    #define POWER_BUTTON_KEYCODE 116  /* power */ 
    52     #define TOUCHSCREEN_BUTTON_KEYCODE 0x14a 
     52    #define TOUCHSCREEN_BUTTON_KEYCODE_MIN 0x140 /* BTN_DIGI */ 
     53    #define TOUCHSCREEN_BUTTON_KEYCODE_MAX 0x14E /* BTN_TOOL_TRIPLETAP */ 
    5354#elif NEOD_PLATFORM_MOTOROLA_EZX 
    5455    #define AUX_BUTTON_KEYCODE 0xa7   /* voice */ 
     
    6768    #define POWER_BUTTON_KEYCODE 0x23 
    6869    #define TOUCHSCREEN_BUTTON_KEYCODE 0x14a 
     70#endif 
     71 
     72#ifndef TOUCHSCREEN_BUTTON_KEYCODE_MIN 
     73    #define TOUCHSCREEN_BUTTON_KEYCODE_MIN TOUCHSCREEN_BUTTON_KEYCODE 
     74    #define TOUCHSCREEN_BUTTON_KEYCODE_MAX TOUCHSCREEN_BUTTON_KEYCODE 
    6975#endif 
    7076 
     
    363369            } 
    364370            else 
    365             if ( event.type == 1 && event.code == TOUCHSCREEN_BUTTON_KEYCODE ) 
     371            if ( event.type == 1 
     372                 && event.code >= TOUCHSCREEN_BUTTON_KEYCODE_MIN 
     373                 && event.code <= TOUCHSCREEN_BUTTON_KEYCODE_MAX ) 
    366374            { 
    367375                if ( event.value == 1 ) /* pressed */ 
Note: See TracChangeset for help on using the changeset viewer.