diff --git a/assets/disk0/home/fsh.js b/assets/disk0/home/fsh.js index 2febe98..1ddaa70 100644 --- a/assets/disk0/home/fsh.js +++ b/assets/disk0/home/fsh.js @@ -908,9 +908,13 @@ while (true) { let navRight = edge(KEY_RIGHT) // -- mouse -- + // MMIO returns VM-screen pixel coords (origin at the top-left of the framebuffer). + // Widget xoff/yoff are passed straight into con.move(y, x), which is 1-indexed, so + // we offset by +1 here. Without this the click registers one cell up-and-left from + // where the user's pointer is, because pixel 0 = con.move(1, 1). let pos = readMousePos() - let charX = (pos[0] / 7) | 0 - let charY = (pos[1] / 14) | 0 + let charX = (pos[0] / 7 | 0) + 1 + let charY = (pos[1] / 14 | 0) + 1 let mouseMoved = (charX !== prevMouseCharX || charY !== prevMouseCharY) prevMouseCharX = charX prevMouseCharY = charY diff --git a/assets/disk0/tvdos/TVDOS.SYS b/assets/disk0/tvdos/TVDOS.SYS index a79881e..437ea4a 100644 --- a/assets/disk0/tvdos/TVDOS.SYS +++ b/assets/disk0/tvdos/TVDOS.SYS @@ -1114,13 +1114,18 @@ inputwork.repeatCount = 0; * where: * "key_down", , , keycode0, keycode1 .. keycode7 * "key_change", , 0, keycode0, keycode1 .. keycode7 (remaining keys that are held down) - * "mouse_down", pos-x, pos-y, 1 // yes there's only one mouse button :p - * "mouse_up", pos-x, pos-y, 0 - * "mouse_move", pos-x, pos-y,