int readchar(void) { int ch; kh_type augchar; while((ch = read_buf()) > 0) { augchar = process_scancode(ch); if(KH_HASDATA(augchar)) { return KH_GETCHAR(augchar); } } return -1; }
// Select the position of the cursor void do_action(void) { process_scancode(keyrows[7-(ycoord-'1')].columns[xcoord-'A'].scancode); sel=!sel; if (sel==0) { if (check_validity() == TRUE) { reorg_historic(1); print_board(); computer_play(); reorg_historic(2); //print_board(); new_cursor_position(); } } else { oldx=xcoord; oldy=ycoord; } }
/* borrowed from nxkbd */ static void mouse_hit(int x, int y) { int row, column; for (row = 0; row < 8; row++) { if (y >= keyrows[row].yoffset && y < keyrows[row].yoffset+keyrows[row].height) { for (column = 0; column < 8; column++) { if (keyrows[row].columns[column].xoffset == 999) { fprintf(stderr, "off end of row\n"); return; } if (x < keyrows[row].columns[column + 1].xoffset) { int scancode = keyrows[row].columns[column].scancode; process_scancode(scancode); return; } } } } fprintf(stderr, "off bottom\n"); }
void isr33_handler(){ process_scancode(); send_eoi(1); }