diff options
| -rw-r--r-- | mousetsr.c | 6 | ||||
| -rw-r--r-- | moustest.c | 19 | ||||
| -rw-r--r-- | sermouse.h | 2 | ||||
| -rw-r--r-- | version.h | 2 |
4 files changed, 25 insertions, 4 deletions
@@ -90,7 +90,8 @@ static void hide_text_cursor(void) { // Restore the character under the old position of the cursor uint16_t __far *ch = get_video_char(&data.video_mode, - data.cursor_pos.x / 8, data.cursor_pos.y / 8); + data.cursor_pos.x / (data.screen_scale.x * 8), + data.cursor_pos.y / (data.screen_scale.y * 8)); *ch = data.cursor_prev_char; data.cursor_visible = false; } @@ -98,7 +99,8 @@ static void hide_text_cursor(void) static void show_text_cursor(void) { uint16_t __far *ch = get_video_char(&data.video_mode, - data.pos.x / 8, data.pos.y / 8); + data.pos.x / (data.screen_scale.x * 8), + data.pos.y / (data.screen_scale.y * 8)); data.cursor_prev_char = *ch; data.cursor_pos = data.pos; *ch = (*ch & data.cursor_text_and_mask) ^ data.cursor_text_xor_mask; @@ -280,6 +280,19 @@ void console_leave() _wrapon(_GWRAPOFF); } +void console_backspace() +{ + _disable(); + console_enter(); + if (ctextpos.col > 0) { + _settextposition(ctextpos.row, ctextpos.col - 1); + _outtext(" "); + _settextposition(ctextpos.row, ctextpos.col - 1); + } + console_leave(); + _enable(); +} + void console_print(char __far *str) { _disable(); @@ -313,6 +326,12 @@ int console_getline(char *buffer, int maxlen) case 0: // Extended: consume and ignore c = getch(); break; + case 8: // Backspace + if (bufpos > 0) { + bufpos--; + console_backspace(); + } + break; case 27: // ESC console_print("\n"); return -1; @@ -42,7 +42,7 @@ enum SERMOUSE_PROTOCOL_MS { SERMOUSE_MS_Y_HI_SHIFT = 4, // 4th byte: - SERMOUSE_MS_BUTTON_CENTER = 1 << 5, + SERMOUSE_MS_BUTTON_CENTER = 1 << 4, SERMOUSE_MS_Z_LO_MASK = 0xF, SERMOUSE_MS_Z_LO_SHIFT = 0 }; @@ -2,6 +2,6 @@ #define VERSION_H #define VERSION_MAJOR 0 -#define VERSION_MINOR 0x71 +#define VERSION_MINOR 0x70 #endif // VERSION_H |
