aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mousetsr.c6
-rw-r--r--moustest.c19
-rw-r--r--sermouse.h2
-rw-r--r--version.h2
4 files changed, 25 insertions, 4 deletions
diff --git a/mousetsr.c b/mousetsr.c
index 68929af..1e33dc2 100644
--- a/mousetsr.c
+++ b/mousetsr.c
@@ -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;
diff --git a/moustest.c b/moustest.c
index 0d71921..c53dcfd 100644
--- a/moustest.c
+++ b/moustest.c
@@ -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;
diff --git a/sermouse.h b/sermouse.h
index fb2184d..eccce5b 100644
--- a/sermouse.h
+++ b/sermouse.h
@@ -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
};
diff --git a/version.h b/version.h
index 1df35fd..b756585 100644
--- a/version.h
+++ b/version.h
@@ -2,6 +2,6 @@
#define VERSION_H
#define VERSION_MAJOR 0
-#define VERSION_MINOR 0x71
+#define VERSION_MINOR 0x70
#endif // VERSION_H