Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 07, 2016, 06:17:16 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Replace mouse click with a key press  (Read 6296 times)

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 677
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
IDEA: Replace mouse click with a key press
« on: August 21, 2007, 04:03:50 AM »
It would be less stressful to press a key on my keyboard than clicking the mouse.

So I was wondering if there's any utility that will do the clicking for me when I point the mouse and press a key (like CTRL or Fn).

To summarize: I want it like this -> I move my mouse to a hyperlink and hit CTRL key and the link should get clicked.

I am aware of MouseTool (it clicks the mouse where ever you point) but the problem with that is accidental clicks. If only there's an option in it to enable its functionality only when a key is pressed...

<a href="https://sridharkatakam.com">My blog</a>
« Last Edit: August 21, 2007, 04:09:01 AM by sri »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #1 on: August 21, 2007, 04:26:23 AM »
Easy...

Ctrl::
  send,{lbutton}
  return
Just save as a .ahk file, install www.autohotkey.com and run :)

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 677
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #2 on: August 21, 2007, 04:39:17 AM »
Thanks jgp. I replaced 'Ctrl' with 'Fn', but it doesn't work. How to modify the script to use 'Fn' as the hotkey?

Better yet, if it has a small dialog in which it asks us to pick the hotkey and detects when I press one or a combination of keys.
<a href="https://sridharkatakam.com">My blog</a>

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #3 on: August 21, 2007, 04:54:45 AM »
Thanks jgp. I replaced 'Ctrl' with 'Fn', but it doesn't work. How to modify the script to use 'Fn' as the hotkey?
I think there's no way for autohotkey to detect fn, sorry :(

Better yet, if it has a small dialog in which it asks us to pick the hotkey and detects when I press one or a combination of keys.
That should be easy, i'll do it in a few hours ;)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #4 on: August 21, 2007, 07:43:48 AM »
I've attached to this post a script with incomplete capabilities.
It works as expected, but can't define keys like "shift", "ctrl" or "alt" to mouse clicks.
To do so, just edit the .ini file that is created after the first launch, and change the "Hotkey" key.
(to have just ctrl, type in "ctrl", to have shift, type "shift", to have "alt", type "alt", to have windows key, type "lwin" or "rwin").

To change the hotkey, delete the .ini file and restart the script.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #5 on: August 21, 2007, 08:06:49 AM »
Thanks jgp. I replaced 'Ctrl' with 'Fn', but it doesn't work. How to modify the script to use 'Fn' as the hotkey?
I think there's no way for autohotkey to detect fn, sorry :(

IIRC the Fn key is hardcoded & is not detectable under Windows. AHK has a way to assign these keys but it is different from one laptop to another.. Check out the Special Keys section in the documentation.. :)

also refer to this thread: http://www.autohotke...viewtopic.php?t=8881


sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 677
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #6 on: August 22, 2007, 02:12:17 AM »
jgpaiva: Thanks. I posted about this in my blog.
<a href="https://sridharkatakam.com">My blog</a>

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #7 on: August 22, 2007, 04:17:14 AM »
jgpaiva: Thanks. I posted about this in my blog.
:Thmbsup: Thanks!

@lanux: love your new sign  :-* :-* :-*

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: IDEA: Replace mouse click with a key press
« Reply #8 on: August 22, 2007, 07:00:49 AM »
@lanux: love your new sign  :-* :-* :-*
yes, thanks to nudone for the cool artwork, :Thmbsup: i'm planning to use the image in my coding snack. :)