Using mouse keys to simulate {Enter} key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
C_P
Posts: 2
Joined: 10 May 2018, 15:19

Using mouse keys to simulate {Enter} key

Post by C_P » 10 May 2018, 16:00

Greetings All:

When using my mouse, I generally select 'copy' or 'paste' from right click drop down window, but for the 'Enter' key (which is mostly required to my copy-paste scenario) I have to go to the keyboard. So what I want to achieve ideally is with a mouse right click drop down window to have an 'enter' selection (like Undo, Cut, Copy, Paste, Delete, .....). If that is too much then I can live with pressing Left and Right Button of the mouse simultaneously to simulate an 'Enter' key pressed. Basically simulate 'Enter' key with combination of mouse keys only.

I did try my beginners luck but error in line 4, obviously there is more learning needed hehehe



Much obliged for your time and kindness
Regards;

Code: Select all

#SingleInstance                ;Execute Once only during testing period
#InstallMouseHook              ;Activate Mouse Hook costing me a lot of memory, 
                              ;so perhaps a drop down window option shall be a better
LButton&RButton::{Enter}   ;L and R mouse  buttons pressed simultaneously 
                             ;should simulate Enter key
Return  

scriptor2016
Posts: 864
Joined: 21 Dec 2015, 02:34

Re: Using mouse keys to simulate {Enter} key

Post by scriptor2016 » 10 May 2018, 23:25

Do you mean something like this?

Code: Select all

Menu, MyMenu, Add, Undo, MenuHandler1
Menu, MyMenu, Add, Cut, MenuHandler2
Menu, MyMenu, Add, Copy, MenuHandler3
Menu, MyMenu, Add, Paste, MenuHandler4
Menu, MyMenu, Add, Delete, MenuHandler5 
Menu, MyMenu, Add, Enter, MenuHandler6  
Return   

MenuHandler1:
sendinput, ^z
Return

MenuHandler2:
sendinput, ^x
Return

MenuHandler3:
sendinput, ^c
Return

MenuHandler4:
sendinput, ^v
Return

MenuHandler5:
sendinput, {delete}
Return

MenuHandler6:
sendinput, {enter}
Return
 
rbutton::Menu, MyMenu, Show
Return

escape::
Exitapp
Return

poetbox
Posts: 112
Joined: 18 Apr 2018, 20:47

Re: Using mouse keys to simulate {Enter} key

Post by poetbox » 11 May 2018, 04:23

well done!

C_P
Posts: 2
Joined: 10 May 2018, 15:19

Re: Using mouse keys to simulate {Enter} key

Post by C_P » 15 May 2018, 13:44

So very grateful scriptor2016.
Script works great with Notepad only. When I try to cut a part of my address on a web browser (Waterfox), after selecting part of my address and I press the mouse's right click the selection goes away, it clears the entire address on 'Cut', it also does not work on 'Total Commander' file name editing....... though showing the 'Enter' option at the end of drop down window selections.

Kindly keep the great work going.
Regards;

Andreimelearncode
Posts: 3
Joined: 25 May 2022, 20:20
Contact:

Re: Using mouse keys to simulate {Enter} key

Post by Andreimelearncode » 03 May 2023, 01:07

Thanks very much i can finally play undertale easily and dodge mettaton attacks ty!

Post Reply

Return to “Ask for Help (v1)”