Fix some todos

This commit is contained in:
Justine Tunney 2023-10-09 23:12:32 -07:00
parent 9d372f48dd
commit 9cc4f33c76
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
13 changed files with 261 additions and 139 deletions

View file

@ -342,23 +342,26 @@ static textwindows int ProcessMouseEvent(const struct NtInputRecord *r,
bs &= kNtFromLeft1stButtonPressed | kNtRightmostButtonPressed;
if (ev & kNtMouseWheeled) {
// scroll wheel (unnatural mode)
if (!(r->Event.MouseEvent.dwControlKeyState &
(kNtShiftPressed | kNtLeftCtrlPressed | kNtRightCtrlPressed |
kNtLeftAltPressed | kNtRightAltPressed))) {
bool isup = ((int)r->Event.MouseEvent.dwButtonState >> 16) > 0;
if (__ttyconf.magic & kTtyXtMouse) {
bool isup = ((int)r->Event.MouseEvent.dwButtonState >> 16) > 0;
if (__ttyconf.magic & kTtyXtMouse) {
if (r->Event.MouseEvent.dwControlKeyState &
(kNtLeftCtrlPressed | kNtRightCtrlPressed)) {
e = isup ? 80 : 81;
goto OutputXtermMouseEvent;
} else {
// we disable mouse highlighting when the tty is put in raw mode
// to mouse wheel events with widely understood vt100 arrow keys
*p++ = 033;
*p++ = !__keystroke.ohno_decckm ? '[' : 'O';
if (isup) {
*p++ = 'A';
} else {
*p++ = 'B';
}
e = isup ? 64 : 65;
}
goto OutputXtermMouseEvent;
} else if (!(r->Event.MouseEvent.dwControlKeyState &
(kNtShiftPressed | kNtLeftCtrlPressed | kNtRightCtrlPressed |
kNtLeftAltPressed | kNtRightAltPressed))) {
// we disable mouse highlighting when the tty is put in raw mode
// to mouse wheel events with widely understood vt100 arrow keys
*p++ = 033;
*p++ = !__keystroke.ohno_decckm ? '[' : 'O';
if (isup) {
*p++ = 'A';
} else {
*p++ = 'B';
}
}
} else if ((bs || currentbs) && (__ttyconf.magic & kTtyXtMouse)) {