Terminal emu: restoring cursor position after ADB
This commit is contained in:
parent
f1e7622e17
commit
0b355bc704
@ -46,7 +46,11 @@ class TerminalEmulator:
|
|||||||
# Is a character
|
# Is a character
|
||||||
ser.write(bytes([key]))
|
ser.write(bytes([key]))
|
||||||
elif int(key) == 1: # CTRL+A, enter ADB mode
|
elif int(key) == 1: # CTRL+A, enter ADB mode
|
||||||
|
# Save cursor position
|
||||||
|
(xPos, yPos) = w.getyx()
|
||||||
self.adbMode(w, ser)
|
self.adbMode(w, ser)
|
||||||
|
# Restore cursor position
|
||||||
|
w.move(xPos, yPos)
|
||||||
|
|
||||||
|
|
||||||
w.refresh()
|
w.refresh()
|
||||||
@ -77,8 +81,6 @@ class TerminalEmulator:
|
|||||||
stdscr.nodelay(True)
|
stdscr.nodelay(True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user