mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-02-03 21:52:24 +00:00
Add an invisible System Caret for blind-helper-software to track
[originally from svn r627]
This commit is contained in:
parent
f80f9d4299
commit
4f3def030a
1
putty.h
1
putty.h
@ -249,6 +249,7 @@ void connection_fatal(char *, ...);
|
|||||||
void fatalbox (char *, ...);
|
void fatalbox (char *, ...);
|
||||||
void beep (int);
|
void beep (int);
|
||||||
void begin_session(void);
|
void begin_session(void);
|
||||||
|
void sys_cursor(int x, int y);
|
||||||
#define OPTIMISE_IS_SCROLL 1
|
#define OPTIMISE_IS_SCROLL 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -211,6 +211,7 @@ void term_update(void) {
|
|||||||
seen_disp_event = seen_key_event = 0;
|
seen_disp_event = seen_key_event = 0;
|
||||||
}
|
}
|
||||||
do_paint (ctx, TRUE);
|
do_paint (ctx, TRUE);
|
||||||
|
sys_cursor(curs_x, curs_y + (scrtop - disptop) / (cols+1));
|
||||||
free_ctx (ctx);
|
free_ctx (ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
window.c
12
window.c
@ -1269,11 +1269,13 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
return 0;
|
return 0;
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
has_focus = TRUE;
|
has_focus = TRUE;
|
||||||
|
CreateCaret(hwnd, NULL, font_width, font_height);
|
||||||
term_out();
|
term_out();
|
||||||
term_update();
|
term_update();
|
||||||
break;
|
break;
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
has_focus = FALSE;
|
has_focus = FALSE;
|
||||||
|
DestroyCaret();
|
||||||
term_out();
|
term_out();
|
||||||
term_update();
|
term_update();
|
||||||
break;
|
break;
|
||||||
@ -1447,6 +1449,16 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
return DefWindowProc (hwnd, message, wParam, lParam);
|
return DefWindowProc (hwnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Move the system caret. (We maintain one, even though it's
|
||||||
|
* invisible, for the benefit of blind people: apparently some
|
||||||
|
* helper software tracks the system caret, so we should arrange to
|
||||||
|
* have one.)
|
||||||
|
*/
|
||||||
|
void sys_cursor(int x, int y) {
|
||||||
|
SetCaretPos(x * font_width, y * font_height);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draw a line of text in the window, at given character
|
* Draw a line of text in the window, at given character
|
||||||
* coordinates, in given attributes.
|
* coordinates, in given attributes.
|
||||||
|
Loading…
Reference in New Issue
Block a user