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

Using applications, configuring, problems
Message
Author
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.

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

#21 Post by Semme »

:D Found the problem.. Feed xbindkeys-config this line and wrap it up!

Code: Select all

xdotool mousemove --polar 0 0 exec xbindkeys &

Jasper

#22 Post by Jasper »

Hi Flash,

I have never used Racy, but if, as seems likely, an executable file can be dragged to and dropped on the desktop and then right-clicked to Edit and set and test a shortcut of your choice; just make the sole line of the file "xdotool mousemove --polar 0 0" and make it executable.

You could Edit out the file name {and perhaps substitute the period/full stop} and even use the "invisible" icon if you really want little or nothing to show on your desktop.

My regards

Alternatively, isn't there a bigger cursor or one with a trail?

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

#23 Post by Flash »

Jasper, a bigger cursor would be nice. The selection is pretty limited and the largest one I've found is not much bigger than the default. It helps, but not enough for me.
EDIT: I take that back. The Whitelarge cursor seems pretty good. Oddly, SeaMonkey still shows the small default cursor. I haven't rebooted yet. Maybe that's why.

As per your suggestion, I created a file xdotool mousemove --polar 0 0 in /root, made it executable and dragged it onto the desktop. The cursor moves to the center of the screen when I click it, but I don't know how to tie it to the F10 key except by using xbindkeys.


Semme, your solution works in multisession Slacko 5.2 (14 Oct 11). :) Now I have to boot the multisession DVD of Racy that I've been using until this morning and see if it works there.

Jasper

#24 Post by Jasper »

Hi Flash,

Certainly in Slacko (hopefully in Racy):

1. right-click on your desktop icon
2. left-click on Edit item
3. left-click on (click to set)
4. Press F10 (or your chosen shortcut combination)
5. left-click Locked (to obviate accidental deletion)
6. left-click OK if it works and you are happy

My regards
Attachments
screenshot.jpg
(52.95 KiB) Downloaded 761 times

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

#25 Post by Semme »

Flash- oh it's gonna work.. I *proofed* it aboard Racy.

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

Hot key to move cursor to center of screen

#26 Post by ETP »

Flash,
I am not certain that just linking to F10 is a wise idea as F10 may well be used by a application that you have in focus. A key combination would probably be better and does not require an icon on the desktop.

First copy your executable file to /usr/local/bin and then add the line shown below to your jwmrc-personal substituting the name of your file for “hunt
Attachments
image-1.png
(24.34 KiB) Downloaded 786 times
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]

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

#27 Post by Semme »

This line alone'll work.. no need for any file drag'n..

Code: Select all

<Key mask="CS" key="m">exec:xdotool mousemove --polar 0 0</Key>

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

Hot key to move cursor to center of screen

#28 Post by ETP »

Semme,
Very well done - the simplest solution is always the best!
This thread is a classic example of ultimately satisfying puppian teamwork.
The virtual pizzas are on Flash!
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]

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

#29 Post by Flash »

Jasper, I went through the right-click-on-icon GUI to tie the F10 key to the icon in Racy but it didn't work. Even though clicking on the desktop icon still centers the cursor in the screen, pressing the F10 key has no effect. Also, I saved the xbindkeys setting to the Racy multisession DVD but when I rebooted, F10 wouldn't work. It's still there in the xbindkeys_config window.
However, saving the xbindkeys setting to the Slacko multisession DVD did work. When I boot from the Slacko multisession DVD, pressing the F10 key centers the cursor.

So I'll just mark this thread "mostly solved" and switch to Slacko. Thanks, everyone who helped. :)

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

#30 Post by Semme »

ETP- yes, elegance in simplicity, teamwork ta'boot! Your comments brought a :) smile to my face..

As for you Flash, I'm guessing you didn't stick with the *jwmrc-personal* line cause you couldn't decide where to place it. Please, some satisfaction.. As an example I've posted the contents of the file I just mentioned so you can see where it goes- cause it works! I also agree F10's not necessarily your best choice.

Go back'n load the below line- the combo is >> ctrl+shift+m

For the sake of purpose, try it. You can always pull it afterwards..

FYI- this works *without* the xbindkeys stuff!
<!-- Personally configurable options for JWM: these override default settings and theme settings -->

<JWM>

<!-- Number of virtual desktops BK: syntax change with jwm 500... -->
<Desktops width="3" height="1"/>

<!-- Double click speed (in milliseconds) -->
<DoubleClickSpeed>400</DoubleClickSpeed>

<!-- Double click delta (in pixels) -->
<DoubleClickDelta>3</DoubleClickDelta>

<!-- The focus model (sloppy or click) -->
<FocusModel>click</FocusModel>

<!-- The snap mode (none, screen, or border) -->
<SnapMode distance="10">none</SnapMode>

<!-- The move mode (outline or opaque) -->
<MoveMode>outline</MoveMode>

<!-- The resize mode (outline or opaque) -->
<ResizeMode>outline</ResizeMode>

<!-- Key bindings -->
<Key key="Up">up</Key>
<Key key="Down">down</Key>
<Key key="Right">right</Key>
<Key key="Left">left</Key>
<Key key="h">left</Key>
<Key key="j">down</Key>
<Key key="k">up</Key>
<Key key="l">right</Key>
<Key key="Return">select</Key>
<Key key="Escape">escape</Key>
<Key key="F12">root:3</Key>

<Key mask="A" key="Tab">next</Key>
<Key mask="A" key="F4">close</Key>
<Key mask="A" key="F10">maximize</Key>
<Key mask="A" key="F6">minimize</Key>
<Key mask="A" key="#">desktop#</Key>
<Key mask="A" key="F1">root:3</Key>
<Key mask="A" key="F2">window</Key>
<Key mask="CS" key="m">exec:xdotool mousemove --polar 0 0</Key>

</JWM>

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

#31 Post by Flash »

Okay, okay. Since xbindkeys didn't work in Racy I tried adding to /root/.jwm/jwmrc-personal as you suggested, but I didn't want to have to use multiple keys so I stuck with F10 for this test:

Code: Select all

<!-- Key bindings -->
<Key key="Up">up</Key>
<Key key="Down">down</Key>
<Key key="Right">right</Key>
<Key key="Left">left</Key>
<Key key="h">left</Key>
<Key key="j">down</Key>
<Key key="k">up</Key>
<Key key="l">right</Key>
<Key key="Return">select</Key>
<Key key="Escape">escape</Key>	
<Key key="F12">root:3</Key>

<Key mask="A" key="Tab">next</Key>
<Key mask="A" key="F4">close</Key>
#<Key mask="A" key="F10">maximize</Key>
<Key mask="A" key="F6">minimize</Key>
<Key mask="A" key="#">desktop#</Key>
<Key mask="A" key="F1">root:3</Key>
<Key mask="A" key="F2">window</Key>
<Key key="F10">exec:xdotool mousemove --polar 0 0</key>

</JWM>
This worked after I saved to the DVD and rebooted!

I'd use the *otherwise wasted* Windows key or one of the so-called multimedia keys but how do I put it in there? Using xbindkeys I get this code for one of the multimedia keys: NoSymbol | m:0x0 + c:178. Can I enter that somehow in jwmrc-personal in place of F10?

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

Hot key to move cursor to center of screen

#32 Post by ETP »

Flash,
1. Backup your savefile just in case of unintended consequences.
2. Open a urxvt terminal, type xev & press enter
3. Briefly press & release the desired windows key.
4. Note the keycode that appears in the two events (press&release)
- In my case this produced 115 - YMMV -
5. Using the keycode that you obtained, if it differs from 115, remove your
code:
ie

Code: Select all

<Key key="F10">exec:xdotool mousemove --polar 0 0</key>
and substitute

Code: Select all

<Key keycode="115">exec:xdotool mousemove --polar 0 0</Key>
6. Restart X
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]

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

#33 Post by Flash »

That worked! Thanks, ETP and Semme.

Since I run from a multisession DVD I don't need to bother with backing up my Save file before I experiment. It is already backed up, on the DVD. If I do something that breaks my Puppy, I don't save that session and when I reboot, Puppy reverts back to the way it was. :)

Xev reported keycode 115 for my Windows or "super" key, so the entry I added to my jwmrc-personal looks exactly like ETP's, above.

Now I have two keys I can press to center my cursor. :lol: The F10 key works through xbindkeys and xdotool, and the Windows key works more directly, through /root/.jwm/jwmrc-personal and xdotool.

So if you're using JWM, you can just install xdotool and make an entry in jwmrc-personal. If you're using a different window manager from JWM, then you may have to also install and use xbindkeys.

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

#34 Post by Semme »

Great! Now get rid of that :wink: *mostly* bit..

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

#35 Post by ETP »

Flash,
Très bien. Take a pew, break out the virtual pizza and chill out to the following video with your personal theme tune!

http://megaswf.com/serve/1201787
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]

Post Reply