From: Martin Pitt Date: Fri, 18 Mar 2011 13:45:42 +0000 (+0100) Subject: input_id: Cover key devices which only have KEY_* > 255 X-Git-Tag: 174~229 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=792479aca54d266430c900f90557ea8d0da2c125;p=systemd input_id: Cover key devices which only have KEY_* > 255 We previously only tested the "key" capabilities for keys between 0 and 255 to determine ID_INPUT_KEY. If there are none, also check for keys in the upper block (KEY_OK/0x160 to KEY_TOUCHPAD_OFF/0x214). --- diff --git a/extras/input_id/input_id.c b/extras/input_id/input_id.c index b2d4a677..588ff899 100644 --- a/extras/input_id/input_id.c +++ b/extras/input_id/input_id.c @@ -148,6 +148,17 @@ static void test_key (const unsigned long* bitmask_ev, found |= bitmask_key[i]; DBG("test_key: checking bit block %lu for any keys; found=%i\n", i*BITS_PER_LONG, found > 0); } + /* If there are no keys in the lower block, check the higher block */ + if (!found) { + for (i = KEY_OK; i < BTN_TRIGGER_HAPPY; ++i) { + if (test_bit (i, bitmask_key)) { + DBG("test_key: Found key %x in high block\n", i); + found = 1; + break; + } + } + } + if (found > 0) puts("ID_INPUT_KEY=1");