Hi, I just downloaded HIDkeys, got it working on a USBasp stick (with fewer keys), and came up with this modification to generate distinct key events when you release the button. So you get 1-17 when pressed, 18-34 when released (in the keyReport array). So when I pressed a certain button, it types an A, and then when I release that button, it types an R.
Code: Select all
// main.c:68
#define NUM_KEYS 17*2
// main.c:266
if(lastKey != key && !keyDidChange){
if (lastKey && lastKey <= NUM_KEYS/2)
lastKey += NUM_KEYS/2;
else
lastKey = key;
keyDidChange = 1;
}
// main.c:200
static const uchar keyReport[NUM_KEYS + 1][2] PROGMEM = {
/* none */ {0, 0}, /* no key pressed */
/* 1 */ {MOD_SHIFT_LEFT, KEY_A},
/* 2 */ {MOD_SHIFT_LEFT, KEY_B},
/* 3 */ {MOD_SHIFT_LEFT, KEY_C},
/* 4 */ {MOD_SHIFT_LEFT, KEY_D},
/* 5 */ {MOD_SHIFT_LEFT, KEY_E},
/* 6 */ {MOD_SHIFT_LEFT, KEY_F},
/* 7 */ {MOD_SHIFT_LEFT, KEY_G},
/* 8 */ {MOD_SHIFT_LEFT, KEY_H},
/* 9 */ {MOD_SHIFT_LEFT, KEY_I},
/* 10 */ {MOD_SHIFT_LEFT, KEY_J},
/* 11 */ {MOD_SHIFT_LEFT, KEY_K},
/* 12 */ {MOD_SHIFT_LEFT, KEY_L},
/* 13 */ {MOD_SHIFT_LEFT, KEY_M},
/* 14 */ {MOD_SHIFT_LEFT, KEY_N},
/* 15 */ {MOD_SHIFT_LEFT, KEY_O},
/* 16 */ {MOD_SHIFT_LEFT, KEY_P},
/* 17 */ {MOD_SHIFT_LEFT, KEY_Q},
/* 18 */ {MOD_SHIFT_LEFT, KEY_R}, // 1-34 release gives these
/* 19 */ {MOD_SHIFT_LEFT, KEY_S},
/* 20 */ {MOD_SHIFT_LEFT, KEY_T},
/* 21 */ {MOD_SHIFT_LEFT, KEY_U},
/* 22 */ {MOD_SHIFT_LEFT, KEY_V},
/* 23 */ {MOD_SHIFT_LEFT, KEY_W},
/* 24 */ {MOD_SHIFT_LEFT, KEY_X},
/* 25 */ {MOD_SHIFT_LEFT, KEY_Y},
/* 26 */ {MOD_SHIFT_LEFT, KEY_Z},
/* 27 */ {MOD_SHIFT_LEFT, KEY_1},
/* 28 */ {MOD_SHIFT_LEFT, KEY_2},
/* 29 */ {MOD_SHIFT_LEFT, KEY_3},
/* 30 */ {MOD_SHIFT_LEFT, KEY_4},
/* 31 */ {MOD_SHIFT_LEFT, KEY_5},
/* 32 */ {MOD_SHIFT_LEFT, KEY_6},
/* 33 */ {MOD_SHIFT_LEFT, KEY_7},
/* 34 */ {MOD_SHIFT_LEFT, KEY_8},
};