add curr_[char,word]_phonetic commands

This commit is contained in:
chrys 2016-08-29 01:11:11 +02:00
parent 083b59a1fd
commit 71da9c7dad
5 changed files with 59 additions and 0 deletions

View File

@ -6,9 +6,11 @@
1-KEY_KP5=curr_word
1-KEY_KP4=prev_word
1-KEY_KP6=next_word
#=curr_word_phonetic
1-KEY_KP2=curr_char
1-KEY_KP1=prev_char
1-KEY_KP3=next_char
#=curr_char_phonetic
#=cursor_position
#=indent_curr_line
1-KEY_KPDOT=exit_review

View File

@ -6,9 +6,11 @@
1-KEY_K=curr_word
1-KEY_J=prev_word
1-KEY_L=next_word
#=curr_word_phonetic
1-KEY_COMMA=curr_char
1-KEY_m=prev_char
1-KEY_DOT=next_char
#=curr_char_phonetic
1-KEY_SLASH=exit_review
#=cursor_position
#=curr_screen

View File

@ -6,9 +6,11 @@
1-FENRIR,1-KEY_KP5=curr_word
1-FENRIR,1-KEY_KP4=prev_word
1-FENRIR,1-KEY_KP6=next_word
1-FENRIR,1-KEY_B=curr_word_phonetic
1-FENRIR,1-KEY_KP2=curr_char
1-FENRIR,1-KEY_KP1=prev_char
1-FENRIR,1-KEY_KP3=next_char
1-FENRIR,1-KEY_W=curr_char_phonetic
1-FENRIR,1-KEY_KPDOT=exit_review
1-FENRIR,1-KEY_J=cursor_position
1-FENRIR,1-KEY_U=curr_screen

View File

@ -0,0 +1,25 @@
#!/bin/python
from utils import char_utils
class command():
def __init__(self):
pass
def run(self, environment):
if (environment['screenData']['newCursorReview'] != None):
cursorPos = environment['screenData']['newCursorReview'].copy()
else:
cursorPos = environment['screenData']['newCursor'].copy()
x, y, currChar = \
char_utils.getCurrentChar(cursorPos['x'], cursorPos['y'], environment['screenData']['newContentText'])
if currChar.strip() == '':
environment['runtime']['outputManager'].presentText(environment, "blank" ,interrupt=True)
else:
currChar = char_utils.getPhonetic(currChar)
environment['runtime']['outputManager'].presentText(environment, currChar ,interrupt=True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -0,0 +1,28 @@
#!/bin/python
from utils import word_utils
from utils import char_utils
class command():
def __init__(self):
pass
def run(self, environment):
if (environment['screenData']['newCursorReview'] != None):
cursorPos = environment['screenData']['newCursorReview'].copy()
else:
cursorPos = environment['screenData']['newCursor'].copy()
x, y, currWord = \
word_utils.getCurrentWord(cursorPos['x'], cursorPos['y'], environment['screenData']['newContentText'])
if currWord.strip() == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else:
firstSequence = True
for c in currWord:
currChar = char_utils.getPhonetic(c)
environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=firstSequence)
firstSequence = False
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass