Skip to content

Commit

Permalink
fixed delete script in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
a.zanella committed Nov 18, 2023
1 parent 6230406 commit dc9f6ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions addon/appModules/edico/edicoObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ def event_typedCharacter(self, ch):

def script_caret_deleteCharacter(self,gesture):
txt = edicoApi.getApiObject().GetCharacter(9, "Ctrl+J")
gesture.send()
txt = edicoApi.getApiObject().GetChar()
newInfo=self.makeTextInfo(textInfos.POSITION_SELECTION)
if(len(newInfo.text) == 0) :
txt = edicoApi.getApiObject().GetChar()
gesture.send()
else :
gesture.send()
txt = edicoApi.getApiObject().GetChar()
txt = txt + ", "+ shMsg.GLB_UNSEL
if config.conf['keyboard']['speakTypedCharacters']:
speech.speakText(txt)
braille.handler.handleCaretMove(self)
Expand Down Expand Up @@ -174,7 +180,6 @@ def script_f4(self,gesture):
'kb:alt+f2': 'caret_moveByCharacter',
'kb:alt+f3': 'caret_moveByCharacter',
'kb:alt+f5': 'caret_moveByCharacter',
'kb:delete': 'caret_moveByCharacter',
'kb:control+d': 'caret_moveByLine',
'kb:f4': 'f4',
"kb:delete": "caret_deleteCharacter",
Expand Down
1 change: 1 addition & 0 deletions addon/appModules/edico/sharedMessages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

GLB_ON = _('on')
GLB_OFF = _('off')
GLB_UNSEL = _("selection removed")

0 comments on commit dc9f6ba

Please sign in to comment.