Skip to content

Commit

Permalink
Tweaking arrow repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
enkiv2 committed Jul 14, 2011
1 parent 16ef6ea commit 229437a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/kb.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ void keyboard_handler(struct regs *r) {

/* Read from the keyboard's data buffer */
scancode = inportb(0x60);
kb_cmd=scancode&0x7f;

kb_cmd=0;
if (!(scancode & 0x80)) {
//scancode &= 0x7f; // clear the top bit
kb_cmd=scancode;
if (scancode==42 || scancode==54) { // shifts
mode|=1;
} else if(scancode==58) { // capslock
Expand Down
9 changes: 9 additions & 0 deletions src/zz.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const void nav_cells(int pid) { //@ handle navigation, display, and editing
break;
}
kb_buf=0;
kb_cmd=0;
if(zz_mode==zz_display_mode) display_cells(); // hack
} else {
if(zz_mode==zz_edit_mode) {
Expand All @@ -249,23 +250,27 @@ const void nav_cells(int pid) { //@ handle navigation, display, and editing
zz_menu_choice--;
cls();
kb_buf='\0';
kb_cmd=0;
display_editmenu();
break;
case 's':
zz_menu_choice++;
cls();
kb_buf='\0';
kb_cmd=0;
display_editmenu();
break;
case 'a':
cls();
kb_buf='\0';
kb_cmd=0;
zz_mode=zz_display_mode;
break;
case 'd':
case '\n':
cls();
kb_buf='\0';
kb_cmd=0;
zz_mode=zz_selected_mode;
break;
default:
Expand Down Expand Up @@ -337,6 +342,7 @@ const void nav_cells(int pid) { //@ handle navigation, display, and editing
forelink=1;
} else {
kb_buf=0;
kb_cmd=0;
yield();
}
locate(0, 1);
Expand All @@ -350,6 +356,7 @@ const void nav_cells(int pid) { //@ handle navigation, display, and editing
editbuf[i]=0;
}
kb_buf=0;
kb_cmd=0;
}
}
}
Expand All @@ -368,6 +375,7 @@ const void nav_cells(int pid) { //@ handle navigation, display, and editing
editbuf[i]=0;
}
kb_buf=0;
kb_cmd=0;
}
if(!editpane(5, 5, VGAX-10, VGAY-10, editbuf, max_edit_size-2, 0x02, 0x20)) {
yield();
Expand Down Expand Up @@ -407,6 +415,7 @@ const void nav_cells(int pid) { //@ handle navigation, display, and editing
modality=0;
} else {
kb_buf=0;
kb_cmd=0;
yield();
}
}
Expand Down

0 comments on commit 229437a

Please sign in to comment.