Hot key to move cursor to center of screen (Solved)

Using applications, configuring, problems
Message
Author
User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Hot key to move cursor to center of screen (Solved)

#1 Post by Flash »

Is there a secret key, or combination of keys, which will move the cursor to the center of the screen? I'm forever running my mouse in circles to find the cursor. Maybe it would save time if I could move the cursor to a known location with a function key.

When Puppy boots, the cursor first shows up in the center of the screen. Could I tie a function key to that script or program?
Last edited by Flash on Wed 04 Jul 2012, 15:54, edited 2 times in total.

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Hot key to move cursor to center of screen

#2 Post by ETP »

Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#3 Post by jamesbond »

xdotool will help you to move the mouse http://www.semicomplete.com/projects/xd ... tool.xhtml (see mousemove)
You need something to bind your keys to an app; for example xbindkeys or sven.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post by Flash »

Thanks, jamesbond, it sure looks like mousemove --polar 0 0 would do the trick, if I could only arrange somehow for the F12 key (for instance) to cause that command to execute. Any chance of an xdotool .pet for Racy Puppy (or any Puppy; I'm not particular :) )? According to the project site, it requires xlib and xtst. I assume Puppy must have xlib. I don't know what else it might require. I can't tell how big it would be either.

Edit: I did a forum search for xdotool. I see that a .pet is available somewhere. It's past my bedtime now so I'll have to look for it tomorrow. :)

stu90

#5 Post by stu90 »

Hi Flash,
Not Sure i it works in Racy or not? but here is a .pet for xdotool
http://www.murga-linux.com/puppy/viewto ... h&id=43168 (44 KB)

xdotool mousemove --polar 0 0
Works for me in Exprimo puppy.

For key bind in openbox at least just add to /root/.config/openbox/rc.xml
in the 'key binding for running applications' "W-c" is Windws/Super key plus c key.

<keybind key="W-c">
<action name="Execute">
<enabled>true</enabled>
<name>center cursor</name>
<command>xdotool mousemove --polar 0 0</command>
</action>
</keybind>

cheers.
Last edited by stu90 on Tue 26 Jun 2012, 10:54, edited 1 time in total.

Jasper

#6 Post by Jasper »

Hi Flash,

Probably useless (but if I remember correctly you use a Kensington roller-ball mouse): if so then whilst reading this, move the ball diagonally left and upward and right-click. The cursor presumably is at the top left corner of the new window (or a least somewhere vertically on the left if there was insufficient upward movement).

Similarly, with a blank screen the cursor should ideally appear at the top left of the Menu window.

I use xdotool for some automated tasks (though not including locating or placing my cursor). I'm none too bright so it took me quite a while (about 3 hours) to get the hang of it and type all commands in appropriate upper/lower case. It works well, though it seems (for my use) to be more consistently reliable with "click" rather than "sloppy" window focus.

My regards

postfs1

#7 Post by postfs1 »

[1]http://ubuntuforums.org/showthread.php?t=1452983

Information about web-page: vBulletin ©2000 - 2012, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry

[2]http://s481.codeinspot.com/q/427604
Information about web-page: Logo, design and layout © 2011 CodeInSpot HugAnswer


There is a combination of keyboard buttons to find the mouse pointer when the 'JWM' is an active window manager:
Alt+F1 ; arrow-'v'

Also:
Alt+Shift+NumLock ; 7 ; Alt+Shift+NumLock

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#8 Post by Flash »

Stu90, the xdotool pet works in Racy too, or at least it correctly executes that command. Thanks, but where is the post it was attached to? I couldn't find it.

Racy doesn't have openbox so I'll have to find another way to make my F10 key (or my Windows key) execute that command.

I little GUI that consists of a field for the command that I want a keypress to execute, and another field where I'd click the key that I want to execute that command, to "teach" Puppy, would be nice right about now. :lol:

Jamesbond, I'm pretty sure I've seen xbindkeys mentioned in the forum. I'll look for it and sven.

Postfs1, none of those key combinations work, at least in my Racy, which I assume uses JWM.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#9 Post by Flash »

Okay, I found the xbindkeys 1.8.3 and xbindkeys-config 0.1.3.3 .pets attached to a post in the forum and installed them. Both .pets are about 44 KB. That small and useful, I don't know why Puppy doesn't come with them. :?

After binding my F10 key to the command, for a while, when I pressed my F10 key the cursor magically appeared in the center of the screen. It quit working though while I was typing this. Ah well, easy come, easy go. :lol: At least I know it can be made to work. I first tried to bind it to the Windows key but that didn't work at all.

What I discovered is that the xbindkeys thing works until I click on something in the system tray. :( Or maybe it's when I click on anything outside the desktop window.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#10 Post by Semme »

You have an .xbindkeysrc file in /root? No? Create it'n reset your bind- X'll probably need a restart..

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#11 Post by Flash »

Thank you, Semme. I should be able to try that by Sunday. :)

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#12 Post by Semme »

Almost forgot- you'll need an executable one-a-deez in your *Startup* folder.. the real reason the bind didn't stick..
Attachments
xbindkeys.sh.gz
(53 Bytes) Downloaded 438 times

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#13 Post by Flash »

Okay Semme, there was already a xbindkeysrc file in /root when I looked. It's a hidden file if that makes any difference.

I copied your xbindkeys.sh to /root/startup and made it executable (using ROX's right-click menu.)

Then I ran Xbindkeys, installed the command, chose the F10 key, saved and exited Xbindkeys, then restarted X.

What I found is that the F10 key will move the cursor to the center of the screen twice for each time I run Xbindkeys and choose the F10 key. Each time, it quits working after pressing the F10 key twice (and moving the cursor off center after each press of the F10 key.) All I have to do to make it work again is run Xbindkeys and choose F10 again.

The xbindkeysrc file in /root is unchanged after it quits working. I can't find anything that changes. :?

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#14 Post by Semme »

Have you refired X since moving the script to Startup? Perhaps a reboot?

I'm guessing even xdotool needs a startup script..

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#15 Post by Flash »

Yes. Sorry, I went back and added that to my last post while you were writing yours.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#16 Post by Semme »

Perhaps..
Attachments
xdotool.sh.gz
(51 Bytes) Downloaded 275 times

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#17 Post by Semme »

Flash- still nogo? Forget the xdotool script. I think Stu's keybinding belongs in your jwmrc-personal, pending syntax..

Somewhere's around:

Code: Select all

<Key mask="A" key="F10">exec:xdotool mousemove --polar 0 0</Key>
Again- refire X..
Last edited by Semme on Sat 30 Jun 2012, 19:53, edited 1 time in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#18 Post by Flash »

Yes, the xdotool script had no effect. I'll try more tomorrow. Thanks for your help.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#19 Post by Semme »

Hey Flash, in JWM- F10 centers for me every time. Since you seem to be having some trouble make'n it stick, drop my script (make executable) into /usr/local/bin, then adjust xbindkeys-config to point towards mouse_finder.sh in the *action* box..

PS- For the moment, forego the jwmrc key binding..
Attachments
mouse_finder.sh.gz
(68 Bytes) Downloaded 258 times

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#20 Post by Flash »

In Racy Puppy 5.2.1.90, JWM, I installed xdotool, xbindkeys, xbindkeys-config, put your mouse_finder.sh in /usr/local/bin and made it executable. Then I started xbindkeys-config, chose F10 for the key, put /usr/local/bin/mouse_finder.sh in the action window and saved it.

When I pressed F10, the cursor went to the upper left corner of the screen. As before, it only did it twice before it quit working. :(

I think I'll try another version of Puppy. I have several old (not too old, though) multisession DVDs lying around, if I can only find one.

Post Reply