Send a message to indicate that all text has been typed. This allows the sender to pace things and reduce the amount of re-typing that is required if the recognizer is indecisive.

This commit is contained in:
Jeremy Rand 2022-02-22 23:54:31 -05:00
parent 87a489eb90
commit 0ec18825ec
3 changed files with 13 additions and 13 deletions

View File

@ -7,17 +7,17 @@
<key>Archive.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<key>Binary.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
<key>DiskImage.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
<integer>4</integer>
</dict>
<key>Listener.xcscheme_^#shared#^_</key>
<dict>
@ -27,7 +27,7 @@
<key>doNotBuild.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
<integer>1</integer>
</dict>
</dict>
</dict>

View File

@ -40,7 +40,6 @@ Start speaking. Best to speak slowly and clearly to get the best results. Voic
There are a number of improvements to make:
* The speech dictation on iOS is often indecisive which leads to lots of backspacing and re-writing of text. There are a couple of things that can be done about this. First, I think the speech APIs provides a confidence value with the transcription so the app could ignore low quality speech and not send anything until iOS is more confident. Second, I could have the GS tell the app when it is ready for more text and in the meantime, if iOS has changed its mind about the text four or more times, it will only send the latest best transcription.
* The iOS app needs to be "good enough" to pass Apple's review process.
* Perhaps a Siri shortcut so you can just tell your phone to dictate to your GS without even starting the ListenerApp.
* Maybe a mode where instead of dictating text, you can dictate commands like "close window", "copy" and "paste" and the right standard commands are sent as key strokes.

View File

@ -37,6 +37,7 @@
#define LISTEN_STATE_MSG 1
#define LISTEN_TEXT_MSG 2
#define LISTEN_SEND_MORE 3
#define WINDOW_CHAR_WIDTH 50
@ -568,6 +569,14 @@ void sendKey(void)
globals->textListHead = textList->header.next;
free(textList);
// If there is no more text to type, let the other end know we are ready for more.
if ((globals->textListHead == NULL) &&
((globals->state == LISTEN_STATE_AWAITING_TEXT) ||
(globals->state == LISTEN_STATE_AWAITING_MSG_HEADER))) {
uint16_t msg = LISTEN_SEND_MORE;
TCPIPWriteTCP(globals->connIpid, (Pointer)&msg, sizeof(msg), FALSE, FALSE);
}
}
@ -589,14 +598,6 @@ void HandleControl(EventRecord *event)
void HandleKey(EventRecord *event)
{
#if 0
if (globals->winPtr != NULL) {
sprintf(globals->line1, "what = $%X", event->what);
sprintf(globals->line2, "message = $%lX", event->message);
sprintf(globals->line3, "modifiers = $%X", event->modifiers);
InvalidateWindow();
}
#endif
}