add curr_[char,word]_phonetic commands
This commit is contained in:
parent
083b59a1fd
commit
71da9c7dad
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
25
src/fenrir-package/commands/commands/curr_char_phonetic.py
Normal file
25
src/fenrir-package/commands/commands/curr_char_phonetic.py
Normal 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
|
28
src/fenrir-package/commands/commands/curr_word_phonetic.py
Normal file
28
src/fenrir-package/commands/commands/curr_word_phonetic.py
Normal 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
|
Loading…
Reference in New Issue
Block a user