----------------------------------------------------------------------------------
@MSGID:
<3a81c244-891a-4de2-b6b2-b1e2a21a6b82n@googlegroups.com> 7582ae1e
@REPLYADDR The Rickster <sled99dog@gmail.com>
@REPLYTO 2:5075/128 The Rickster
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:
<3a81c244-891a-4de2-b6b2-b1e2a21a6b82n@googlegroups.com>
@TZUTC: -0700
@PID: G2/1.0
@TID: FIDOGATE-5.12-ge4e8b94
There is a windows speech application that is invoked with the Win
key + h. Thanks to greg and others, it can be done programmatically.
However the focus must be on an entry box so that the spoken text may be
placed there. However, what happens is that when the .tcl script is
selected in explorer, the cursor remains over the .tcl file and the code
gets invoked twice. So, it seems that focus is not moved away and the
mouse down invokes it a second time. I thought focusmodel and focus would
make what was needed happen.
The twapi mouse down has to occur in the entry box.
(by the way, if I\\we can get this working then there is a way
to use azure speech for $0)
The tcl code is -
package require twapi
set SRStatement {}
wm iconify .
console hide
set top [toplevel .t1 -background {light blue}]
set theLabel [label $top.l1 -text {hello joe}]
set theEntryBox [ttk::entry $top.e1 -textvariable SRStatement -width 20
-font {{Segoe UI bold} 10}]
set theExit [ttk::button $top.b1 -text Close -command {destroy . $top ; exit}]
pack $theLabel $theEntryBox $theExit -side top -pady 16
wm focusmodel $top active
tkwait visibility $top
focus $theEntryBox
update
# make the mouse selection to indicate the text entry location for
speech rec output
::twapi::click mouse button right
::twapi::send input {"keydown 0x5B 0" "key 0x48 0" "keyup 0x5B 0"}
--- G2/1.0
* Origin: usenet.network (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441