You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/prompt_toolkit/key_binding/bindings/cpr.py

26 lines
677 B

from __future__ import unicode_literals
from prompt_toolkit.keys import Keys
from ..key_bindings import KeyBindings
__all__ = [
'load_cpr_bindings',
]
def load_cpr_bindings():
key_bindings = KeyBindings()
@key_bindings.add(Keys.CPRResponse, save_before=lambda e: False)
def _(event):
"""
Handle incoming Cursor-Position-Request response.
"""
# The incoming data looks like u'\x1b[35;1R'
# Parse row/col information.
row, col = map(int, event.data[2:-1].split(';'))
# Report absolute cursor position to the renderer.
event.app.renderer.report_absolute_cursor_row(row)
return key_bindings