int kpad_scan_line( SCANINFO *sinfo, unsigned int i) { __u8 col, downkey, upkey; static __u8 row; unsigned int j; if (i == 0) row = 0x01; out_raw(~row); udelay(ROW_DELAY); in_col(&col); sinfo->key[i] = col; if (~(sinfo->key[i])) sinfo->push_flg = 1; sinfo->diffkey[i] = sinfo->key[i] ^ sinfo->lastkey[i]; if (sinfo->diffkey[i]) { downkey = ~sinfo->key[i] & sinfo->diffkey[i]; /* key went down */ upkey = sinfo->key[i] & sinfo->diffkey[i]; /* key went up */ for (j = 0, col=0x80; j < 8; j++, col >>= 1) { if (downkey & col) handle_scancode( KEYCODE(i, j), 1 ); else if ( upkey & col ) handle_scancode( KEYCODE(i, j) | KBUP, 0 ); } }
void ipod_init_volume_control() { ipod_init_sound(); ipod_init_input(); ipod_init_backlight(); int input, exit; exit = 0; while (exit != 1) { input = ipod_get_keypress(); if (!KEYSTATE(input)) { // Pressed input = KEYCODE(input); switch (input) { case SCROLL_R: if (SCROLL_MOD(SCROLL_MOD_NUM)) { ipod_volume++; if (ipod_volume > 70) ipod_volume = 70; // To be safe - 70 is VERY loud ipod_update_volume(); } break; case KEY_ACTION: ipod_toggle_backlight(); break; case SCROLL_L: if (SCROLL_MOD(SCROLL_MOD_NUM)) { ipod_volume--; if (ipod_volume < 0) ipod_volume = 0; // Negative volume DNE! ipod_update_volume(); } break; case KEY_MENU: exit = 1; break; default: break; } } } printf("Exiting...\n"); ipod_exit_sound(); ipod_exit_input(); }
/* ? 9 */ KEYBTDECL(0xe7, 0x39, true, 10), /* ? 0 */ KEYBTDECL(0xe0, 0x30, true, 11), /* ) ? */ KEYBTDECL(0x29, 0xb0, true, 12), /* = + */ KEYBTDECL(0x3d, 0x2b, true, 13), /* a A */ KEYBTDECLEX6(0x61, 0x41, true, 16, 0x61, 0x41, 0xe2, 0xc2, 0xe4, 0xc4), /* z Z */ KEYBTDECL(0x7a, 0x5a, true, 17), /* e E */ KEYBTDECLEX6(0x65, 0x45, true, 18, 0x65, 0x45, 0xea, 0xca, 0xeb, 0xcb), /* r R */ KEYBTDECL(0x72, 0x52, true, 19), /* t T */ KEYBTDECL(0x74, 0x54, true, 20), /* y Y */ KEYBTDECLEX6(0x79, 0x59, true, 21, 0x79, 0x59, 0, 0, 0xff, 0), /* u U */ KEYBTDECLEX6(0x75, 0x55, true, 22, 0x75, 0x55, 0xfb, 0xdb, 0xfc, 0xdc), /* i I */ KEYBTDECLEX6(0x69, 0x49, true, 23, 0x69, 0x49, 0xee, 0xce, 0xef, 0xcf), /* o O */ KEYBTDECLEX6(0x6f, 0x4f, true, 24, 0x6f, 0x4f, 0xf4, 0xd4, 0xf6, 0xd6), /* p P */ KEYBTDECL(0x70, 0x50, true, 25), /* ^ ? */ KEYBT(0x5e, 0xa8, true, 1, 2, KEYCODE(0x5e, 26, 0), KEYCODE(0xa8, 26, 1)), /* $ ? } */ KEYBTDECL(0x24, 0xa3, true, 27), /* q Q */ KEYBTDECL(0x71, 0x51, true, 30), /* s S */ KEYBTDECL(0x73, 0x53, true, 31), /* d D */ KEYBTDECL(0x64, 0x44, true, 32), /* f F */ KEYBTDECL(0x66, 0x46, true, 33), /* g G */ KEYBTDECL(0x67, 0x47, true, 34), /* h H */ KEYBTDECL(0x68, 0x48, true, 35), /* j J */ KEYBTDECL(0x6a, 0x4a, true, 36), /* k K */ KEYBTDECL(0x6b, 0x4b, true, 37), /* l L */ KEYBTDECL(0x6c, 0x4c, true, 38), /* m M */ KEYBTDECL(0x6d, 0x4d, true, 39), /* ? % */ KEYBTDECL(0xf9, 0x25, true, 40), /* * ? */ KEYBTDECL(0x2a, 0xb5, true, 43),
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) { return KEYCODE(layer, row, col); }