add toggle_emoticon
This commit is contained in:
parent
f817c12618
commit
bc396a9223
@ -66,6 +66,7 @@ KEY_FENRIR,KEY_F4=toggle_speech
|
|||||||
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||||
|
#=toggle_emoticons
|
||||||
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
||||||
KEY_FENRIR,KEY_Q=quit_fenrir
|
KEY_FENRIR,KEY_Q=quit_fenrir
|
||||||
KEY_FENRIR,KEY_T=time
|
KEY_FENRIR,KEY_T=time
|
||||||
|
@ -66,6 +66,7 @@ KEY_FENRIR,KEY_F4=toggle_speech
|
|||||||
KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level
|
KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||||
KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output
|
KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output
|
||||||
|
#=toggle_emoticons
|
||||||
KEY_FENRIR,KEY_ENTER=toggle_auto_read
|
KEY_FENRIR,KEY_ENTER=toggle_auto_read
|
||||||
KEY_FENRIR,KEY_Q=quit_fenrir
|
KEY_FENRIR,KEY_Q=quit_fenrir
|
||||||
KEY_FENRIR,KEY_T=time
|
KEY_FENRIR,KEY_T=time
|
||||||
|
@ -66,6 +66,7 @@ KEY_FENRIR,KEY_F4=toggle_speech
|
|||||||
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||||
|
#=toggle_emoticons
|
||||||
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
||||||
KEY_FENRIR,KEY_Q=quit_fenrir
|
KEY_FENRIR,KEY_Q=quit_fenrir
|
||||||
KEY_FENRIR,KEY_T=time
|
KEY_FENRIR,KEY_T=time
|
||||||
|
@ -100,6 +100,7 @@ debugLevel=3
|
|||||||
punctuationProfile=default
|
punctuationProfile=default
|
||||||
punctuationLevel=some
|
punctuationLevel=some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
|
emoticons=True
|
||||||
# define the current fenrir key
|
# define the current fenrir key
|
||||||
fenrirKeys=KEY_KP0,KEY_META
|
fenrirKeys=KEY_KP0,KEY_META
|
||||||
timeFormat=%H:%M:%P
|
timeFormat=%H:%M:%P
|
||||||
|
@ -100,6 +100,7 @@ debugLevel=1
|
|||||||
punctuationProfile=default
|
punctuationProfile=default
|
||||||
punctuationLevel=Some
|
punctuationLevel=Some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
|
emoticons=True
|
||||||
# define the current fenrir key
|
# define the current fenrir key
|
||||||
fenrirKeys=KEY_KP0,KEY_META
|
fenrirKeys=KEY_KP0,KEY_META
|
||||||
timeFormat=%H:%M:%P
|
timeFormat=%H:%M:%P
|
||||||
|
@ -98,6 +98,7 @@ debugLevel=0
|
|||||||
punctuationProfile=default
|
punctuationProfile=default
|
||||||
punctuationLevel=some
|
punctuationLevel=some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
|
emoticons=True
|
||||||
# define the current fenrir key
|
# define the current fenrir key
|
||||||
fenrirKeys=KEY_KP0,KEY_META
|
fenrirKeys=KEY_KP0,KEY_META
|
||||||
timeFormat=%H:%M%P
|
timeFormat=%H:%M%P
|
||||||
|
@ -51,6 +51,7 @@ debugLevel=0
|
|||||||
punctuationProfile=default
|
punctuationProfile=default
|
||||||
punctuationLevel=some
|
punctuationLevel=some
|
||||||
numberOfClipboards=10
|
numberOfClipboards=10
|
||||||
|
emoticons=True
|
||||||
fenrirKeys=KEY_KP0
|
fenrirKeys=KEY_KP0
|
||||||
timeFormat=%H:%M:%P
|
timeFormat=%H:%M:%P
|
||||||
dateFormat="%A, %B %d, %Y"
|
dateFormat="%A, %B %d, %Y"
|
||||||
|
26
src/fenrir/commands/commands/toggle_emoticons.py
Normal file
26
src/fenrir/commands/commands/toggle_emoticons.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/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 'enables or disables announcement of emoticons insteed of chars'
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons')))
|
||||||
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
|
||||||
|
self.env['runtime']['outputManager'].presentText("emoticons enabled", soundIcon='', interrupt=True)
|
||||||
|
else:
|
||||||
|
self.env['runtime']['outputManager'].presentText("emoticons disabled", soundIcon='', interrupt=True)
|
||||||
|
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
@ -40,7 +40,8 @@ class punctuationManager():
|
|||||||
def proceedPunctuation(self, text, ignorePunctuation=False):
|
def proceedPunctuation(self, text, ignorePunctuation=False):
|
||||||
resultText = text
|
resultText = text
|
||||||
resultText = self.useCustomDict(resultText, self.env['punctuation']['CUSTOMDICT'])
|
resultText = self.useCustomDict(resultText, self.env['punctuation']['CUSTOMDICT'])
|
||||||
resultText = self.useCustomDict(resultText, self.env['punctuation']['EMOJDICT'])
|
if self.env['runtime']['settingsManager'].getSetting('general', 'emoticons'):
|
||||||
|
resultText = self.useCustomDict(resultText, self.env['punctuation']['EMOJDICT'])
|
||||||
currPunctLevel = ''
|
currPunctLevel = ''
|
||||||
if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']:
|
if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']:
|
||||||
currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()]
|
currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()]
|
||||||
|
@ -44,6 +44,7 @@ settings = {
|
|||||||
'punctuationProfile':'default',
|
'punctuationProfile':'default',
|
||||||
'punctuationLevel': 1,
|
'punctuationLevel': 1,
|
||||||
'numberOfClipboards': 10,
|
'numberOfClipboards': 10,
|
||||||
|
'emoticons': True,
|
||||||
'fenrirKeys': ['KEY_KP0'],
|
'fenrirKeys': ['KEY_KP0'],
|
||||||
'timeFormat': '%I:%M%P',
|
'timeFormat': '%I:%M%P',
|
||||||
'dateFormat': '%A, %B %d, %Y',
|
'dateFormat': '%A, %B %d, %Y',
|
||||||
|
Loading…
Reference in New Issue
Block a user