mirror of
https://github.com/cy384/ssheven.git
synced 2026-05-21 06:45:34 -06:00
basic mouse support
This commit is contained in:
parent
af285b6e6c
commit
f119a63078
3 changed files with 18 additions and 0 deletions
|
|
@ -149,6 +149,15 @@ void draw_screen(Rect* r)
|
|||
}
|
||||
}
|
||||
|
||||
// p is in window local coordinates
|
||||
void mouse_click(Point p, bool click)
|
||||
{
|
||||
int row = p.v / con.cell_height;
|
||||
int col = p.h / con.cell_width;
|
||||
vterm_mouse_move(con.vterm, row, col, VTERM_MOD_NONE);
|
||||
vterm_mouse_button(con.vterm, 1, click, VTERM_MOD_NONE);
|
||||
}
|
||||
|
||||
void draw_screen_color(Rect* r)
|
||||
{
|
||||
// get the intersection of our console region and the update region
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue