Просмотр исходного кода

\x1b[?1000h works. 1006 does not.

Steve Thielemann 2 лет назад
Родитель
Сommit
d36febbffd
2 измененных файлов с 6 добавлено и 1 удалено
  1. 1 0
      door/input.go
  2. 5 1
      testdoor/testdoor.go

+ 1 - 0
door/input.go

@@ -231,6 +231,7 @@ func (d *Door) GetKey() int {
 		}
 
 		if strings.HasPrefix(string(extended), "[M") && len(extended) == 5 {
+			// log.Printf("MOUSE Extended %#v\n", extended)
 			Mouse.Button = int(extended[2]) - 0x20 + 1
 			Mouse.X = int(extended[3]) - 0x21 + 1
 			Mouse.Y = int(extended[4]) - 0x21 + 1

+ 5 - 1
testdoor/testdoor.go

@@ -668,8 +668,11 @@ func main() {
 	// bold := door.Color(1, 37, 40)
 	var bolder string = door.ColorText("BLI BOLD YEL ON BLUE")
 	d.Write("Welcome to " + bolder + "door32.sys" + door.Reset + door.CRNL + "..." + door.CRNL)
+
+	// cterm.txt +687
 	// d.Write("\x1b[?9h") // enable mouse X10 support
-	d.Write("\x1b[?1000h") // enable mouse
+	d.Write("\x1b[?1000h") // enable any-event mouse
+	// d.Write("\x1b[?1006h") // enable SGR Extended mouse // doesn't work in xterm or syncterm?!?
 	press_keys(&d)
 	// press_a_key(&d)
 	d.Write(door.CRNL)
@@ -746,6 +749,7 @@ func main() {
 	}
 
 	d.Write("\x1b[?1000l") // disable mouse
+	// d.Write("\x1b[?1006l") // disable mouse
 	d.Write(door.Reset + door.CRNL)
 
 	message = fmt.Sprintf("Returning to the %s BBS..."+door.CRNL, d.Config.BBSID)