Remote Scrolling


12 posts
by vonzepp » Fri Jun 28, 2013 6:45 am
Hi

I am using my Raspberry Pi as a display (with a 7 inch screen) for various sources of information. Weather, recipes, news etc. Now I have alot of this working(occasionally) with voice control. However what I can not get working is the ability to scroll down the screen without the need to use a keyboard. So what I want is to be able to do is basically emulate say the pressing the "page down" key on the keyboard from a program. So I can have no keyboard attached to the Pi
Posts: 13
Joined: Fri Mar 08, 2013 5:39 pm
by PiGraham » Fri Jun 28, 2013 6:52 am
I believe you can run the processes that would require a PgDn keypress (or any keyboard input) to take input from a named pipe and send a PgDn to them when required. Input to a console process comes via the process's stdin and connecting that to a pipe you can send to delivers information to the process as if you typed it.

See here:
http://stackoverflow.com/questions/5374 ... al-process
Posts: 1144
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville
by joan » Fri Jun 28, 2013 7:10 am
You don't specify.

Assuming you are using the console text screen you can use VT220 escape codes, to stdout.

E.g.
Code: Select all
void putTTY(char * buf)
{
   write(1, buf, strlen(buf));
}

void putTTY("\033c"); /* clear console */

/* position cursor */
void putTTYstr(int row, int col, char * buf)
{
   char str[256];

   sprintf(str, "\033[%d;%dH%s", row, col, buf);

   putTTY(str);
}
User avatar
Posts: 6562
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by vonzepp » Fri Jun 28, 2013 7:44 am
Hi

I want to be able to scroll on the Desktop. Mainly the Internet Browser.
Posts: 13
Joined: Fri Mar 08, 2013 5:39 pm
by PiGraham » Fri Jun 28, 2013 7:53 am
vonzepp wrote:Hi

I want to be able to scroll on the Desktop. Mainly the Internet Browser.


Is this a page you wrote that you can put some javascript on?
There are ways to scroll web pages:
http://www.mediacollege.com/internet/ja ... croll.html
Posts: 1144
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville
by joan » Fri Jun 28, 2013 8:04 am
vonzepp wrote:Hi

I want to be able to scroll on the Desktop. Mainly the Internet Browser.

Under X? Try http://sourceforge.net/projects/xmacro/
User avatar
Posts: 6562
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by vonzepp » Fri Jun 28, 2013 8:05 am
Hi

I would rather use pages I haven't written. For instance something like http://www.bbc.co.uk/food/recipes/salmo ... h_36704.mp
So basically being able to scroll down the page as I am cooking by voice control.

But maybe if there is no way I might have to look into automatically rewriting the page.
Posts: 13
Joined: Fri Mar 08, 2013 5:39 pm
by vonzepp » Fri Jun 28, 2013 8:15 am
Hi

I will give xmacro a go. Thanks for the tip. Also apologies that last link should really have been. http://www.bbc.co.uk/food/recipes/raspb ... e_49934.mp
Posts: 13
Joined: Fri Mar 08, 2013 5:39 pm
by joan » Fri Jun 28, 2013 8:19 am
vonzepp wrote:Hi

I will give xmacro a go. Thanks for the tip. Also apologies that last link should really have been. http://www.bbc.co.uk/food/recipes/raspb ... e_49934.mp

The last time I wanted to do something similar I downloaded a package from the Debian repository. I don't remember which one.

It's worth bearing in mind that there are lots of Linux machines. Try googling for "linux simulate keypress" if xmacro doesn't work for you.
User avatar
Posts: 6562
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by joan » Fri Jun 28, 2013 8:22 am
I probably used xdotool.

sudo apt-get install xdotool
User avatar
Posts: 6562
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by PiGraham » Fri Jun 28, 2013 8:39 am
joan wrote:I probably used xdotool.

sudo apt-get install xdotool


Solid gold Joan!
Posts: 1144
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville
by vonzepp » Fri Jun 28, 2013 8:52 pm
Hi

Thanks a million this is prefect.
Posts: 13
Joined: Fri Mar 08, 2013 5:39 pm