if node.isEditable() or service.isShowInputWindow()
local txt,s=node.text,""
local gb=node.getTextSelectionEnd()
local n1,n2=0,-1
if txt and txt~="" and not node.isShowingHintText()
local tbl={"，","。","：","？","！","……","；",",",".","!","?",";","\n","(",")"}
for n=gb-1,1,-1 do
if table.find(tbl,utf8.sub(txt,n,n)) then
n1=n
break
end
end
if gb<utf8.len(txt) then
for n=gb,utf8.len(txt)-1,1 do
if table.find(tbl,utf8.sub(txt,n,n)) then
n2=n
break
end
end
end
s=utf8.sub(txt,n1+1,n2)
txt=n2==-1 and utf8.sub(txt,1,n1) or utf8.sub(txt,1,n1)..utf8.sub(txt,n2+1,-1)
service.setText(node,txt)
service.setSelection(node,n1)
service.speak(s.."已删除")
if txt==""
service.speak("已清除")
end
else
service.speak("编辑框为空")
end
return true
end
service.execute("逐字浏览",node)
return true