[quoted lines by Elijah Massey on 2025/07/06 at 13:51 -0500]

>I'm not sure about the right command to send. The command reference states 
>that the ROUTE command routes the cursor to a character, and takes a column 
>parameter, while the ROUTE_LINE command moves the cursor to a specific row. 
>This made me think the best approach would be to send them both one after the 
>other, but this doesn't work because ROUTE interrupts the movement of the 
>cursor triggered by ROUTE_LINE and vice versa. 

No - as you discovered - that won't work.

>Also, I tried just sending ROUTE, with the column parameter set to the index 
>of the Braille character in the matrix, so for the first character of line 3 I 
>would pass 64. 

Yes, assuming a braille window width of 32 columns, that's the right way to do 
it.

>However, this never moved the cursor beyond the first line. 

Please apply the attached patch - multiline-routing.patch - and let us know if 
it fixes (or doesn't fix) the problem.

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke            | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: [email protected]  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://mielke.cc/xmother.html (Letter from a Feminist ex-Mother)
diff --git a/Programs/cmd_touch.c b/Programs/cmd_touch.c
index 829e8a042..35f00ec91 100644
--- a/Programs/cmd_touch.c
+++ b/Programs/cmd_touch.c
@@ -141,7 +141,7 @@ handleTouchCommands (int command, void *data) {
         handleTouchOff(data);
       } else {
         int at;
-        if (isTextOffset(arg, &at, NULL, 0)) handleTouchAt(at, data);
+        if (isTextOffset(arg, NULL, &at, NULL, 0)) handleTouchAt(at, data);
       }
 
       break;
diff --git a/Programs/cmd_utils.c b/Programs/cmd_utils.c
index d144d9efa..ea1eb4a98 100644
--- a/Programs/cmd_utils.c
+++ b/Programs/cmd_utils.c
@@ -47,7 +47,7 @@ alertLineSkipped (unsigned int *count) {
 }
 
 int
-isTextOffset (int arg, int *first, int *last, int relaxed) {
+isTextOffset (int arg, int *row, int *first, int *last, int relaxed) {
   int y = arg / brl.textColumns;
   if (y >= brl.textRows) return 0;
   if ((ses->winy + y) >= scr.rows) return 0;
@@ -105,6 +105,7 @@ isTextOffset (int arg, int *first, int *last, int relaxed) {
     if (last) *last = x;
   }
 
+  if (row) *row = y;
   return 1;
 }
 
@@ -112,12 +113,12 @@ int
 getCharacterCoordinates (int arg, int *row, int *first, int *last, int 
relaxed) {
   if (arg == BRL_MSK_ARG) {
     if (!SCR_CURSOR_OK()) return 0;
-    *row = scr.posy;
+    if (row) *row = scr.posy;
     if (first) *first = scr.posx;
     if (last) *last = scr.posx;
   } else {
-    if (!isTextOffset(arg, first, last, relaxed)) return 0;
-    if (row) *row = ses->winy;
+    if (!isTextOffset(arg, row, first, last, relaxed)) return 0;
+    if (row) *row += ses->winy;
     if (first) *first += ses->winx;
     if (last) *last += ses->winx;
   }
diff --git a/Programs/cmd_utils.h b/Programs/cmd_utils.h
index 4658455e3..de8470c0a 100644
--- a/Programs/cmd_utils.h
+++ b/Programs/cmd_utils.h
@@ -27,7 +27,7 @@ extern "C" {
 
 extern void alertLineSkipped (unsigned int *count);
 
-extern int isTextOffset (int arg, int *first, int *last, int relaxed);
+extern int isTextOffset (int arg, int *row, int *first, int *last, int 
relaxed);
 
 extern int getCharacterCoordinates (int arg, int *row, int *first, int *last, 
int relaxed);
 
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: [email protected]
For general information, go to: http://brltty.app/mailman/listinfo/brltty

Reply via email to