new commands: cursor_line and cursor_column for announce current position
This commit is contained in:
parent
5be38ed831
commit
8846527639
@ -31,6 +31,8 @@ KEY_FENRIR,KEY_KPDOT=exit_review
|
||||
KEY_FENRIR,KEY_KP5=curr_screen
|
||||
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
|
||||
KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
|
||||
#=cursor_column
|
||||
#=cursor_lineno
|
||||
KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_1=set_bookmark_1
|
||||
KEY_FENRIR,KEY_1=bookmark_1
|
||||
|
@ -30,6 +30,8 @@ KEY_FENRIR,KEY_SHIFT,KEY_DOT=cursor_position
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_K=curr_screen
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_I=curr_screen_before_cursor
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_COMMA=curr_screen_after_cursor
|
||||
#=cursor_column
|
||||
#=cursor_lineno
|
||||
KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_1=set_bookmark_1
|
||||
KEY_FENRIR,KEY_1=bookmark_1
|
||||
|
@ -29,8 +29,10 @@ KEY_KPDOT=cursor_position
|
||||
KEY_FENRIR,KEY_I=indent_curr_line
|
||||
KEY_FENRIR,KEY_KPDOT=exit_review
|
||||
KEY_FENRIR,KEY_KP5=curr_screen
|
||||
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
|
||||
KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
|
||||
#KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
|
||||
#KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
|
||||
KEY_FENRIR,KEY_KP2=cursor_column
|
||||
KEY_FENRIR,KEY_KP8=cursor_lineno
|
||||
KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_1=set_bookmark_1
|
||||
KEY_FENRIR,KEY_1=bookmark_1
|
||||
|
25
src/fenrir/commands/commands/cursor_column.py
Normal file
25
src/fenrir/commands/commands/cursor_column.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'presents the current column number for review cursor in review mode or the text cursor if not. Starts with 1'
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['outputManager'].presentText(str(cursorPos['x'] + 1) , interrupt=True)
|
||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
||||
self.env['runtime']['outputManager'].presentText(' column number' , interrupt=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
25
src/fenrir/commands/commands/cursor_lineno.py
Normal file
25
src/fenrir/commands/commands/cursor_lineno.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'presents the current line number for review cursor in review mode or the text cursor if not. Starts with 1'
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['outputManager'].presentText(str(cursorPos['y'] + 1), interrupt=True)
|
||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
||||
self.env['runtime']['outputManager'].presentText(' line number' , interrupt=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
@ -127,3 +127,9 @@ class outputManager():
|
||||
self.env['runtime']['debug'].writeDebugOut("\"playSoundIcon\" in outputManager.speakText ",debug.debugLevel.ERROR)
|
||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
return False
|
||||
def announceActiveCursor(self, interrupt_p=False):
|
||||
if self.env['runtime']['cursorManager'].isReviewMode():
|
||||
self.presentText(' review cursor ', interrupt=interrupt_p)
|
||||
else:
|
||||
self.presentText(' text cursor ', interrupt=interrupt_p)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user