Jump to content


Photo

Activate macro with "keypad enter" and/or "backspace" key?


  • Please log in to reply
9 replies to this topic

#1 TsunamiZ

TsunamiZ

    Expert

  • Members
  • PipPipPipPip
  • 373 posts

Posted 05 July 2009 - 02:57 PM

Is it possible to activate a macro with "keypad enter" and/or "backspace" key? If not, can it be added as a feature in the next version? I would very much like to have pressing the "keypad enter" play a custom confirmation sound in one of my programs.

#2 Scasper

Scasper

    Expert

  • Members
  • PipPipPipPip
  • 562 posts
  • Gender:Male

Posted 05 July 2009 - 11:15 PM

Is it possible to activate a macro with "keypad enter" and/or "backspace" key? If not, can it be added as a feature in the next version?

Backspace can be used to activate a macro in Macro Express Pro (Macro Express 4.x)

Enter cannot be used to activate macros in the 3.x series and not so far in Macro Express Pro. To submit a feature request, please use the form at:

http://macros.com/requestfeature.htm
Steve CasperMacro Lover

"If wishes were horses, we'd all be eating steak." - Jayne Cobb

#3 Rand

Rand

    Member

  • Members
  • PipPip
  • 81 posts

Posted 05 July 2009 - 11:42 PM

Is it possible to activate a macro with mousewheel up or mousewheel down?

#4 Scasper

Scasper

    Expert

  • Members
  • PipPipPipPip
  • 562 posts
  • Gender:Male

Posted 06 July 2009 - 09:38 AM

Is it possible to activate a macro with mousewheel up or mousewheel down?

Not intrinsically, as far as I can tell.

Of course, if you have software for your mouse that allows you to program your mouse-wheel ups-and-down to mimic keystrokes, then it should be possible to set a macro to launch based on those keystrokes, thereby allowing you to activate a macro with the mouse-wheel movements.
Steve CasperMacro Lover

"If wishes were horses, we'd all be eating steak." - Jayne Cobb

#5 ejs

ejs

    Member

  • Members
  • PipPip
  • 61 posts

Posted 08 July 2009 - 07:18 PM

Is it possible to activate a macro with "keypad enter" and/or "backspace" key?

Here is how you can activate Macro Express macros using hotkeys that Macro Express does not inherently support, such as backspace or keypad enter.

There is a free downloadable macro program called Autohotkey (www.autohotkey.com), which I use simultaneously with Macro Express. I prefer to write my macros in Macro Express because it has an easier interface, but if I want that macro activated with a hotkey that Macro Express does not offer, then I write a trivial macro in Autohotkey that runs the Macro Express macro whenever the hotkey is pressed.

Here are the Autohotkey scripts to run Macro Express macros for the hotkeys you asked about. You just need to replace "macro express macro nickname" with the nickname of your macro, and possibly adjust the path to the exe file on your system.

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS MACROS.

; hotkey is Backspace
Backspace::
KeyWait Backspace, L
Run C:\Program Files\Macro Express3\meproc.exe /Amacro express macro nickname
return

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS MACROS.

; hotkey is NumpadEnter
NumpadEnter::
KeyWait NumpadEnter, L
Run C:\Program Files\Macro Express3\meproc.exe /Amacro express macro name
return
If you want to limit the scope of the Autohotkey hotkey to specific active windows then:

i) put the following line as the very first line in your script file (so that it supports partial matches in window titles)

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS.

SetTitleMatchMode, 2
ii) use #IfWinActive, windowtitle as the first line in the macro subroutine (before the hotkey line) if you want the hotkey to be active only if a window with the specified window title is active. Put #IfWinActive as the last line in the subroutine after the return.

For example, if I want the backspace hotkey to be active only in windows named Notepad or file manager

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS MACROS.

#IfWinActive, Notepad
Backspace::
#IfWinActive, File Manager
Backspace::
KeyWait Backspace, L
Run C:\Program Files\Macro Express3\meproc.exe /Amacro express macro nickname
return
#IfWinActive
iii) use #IfWinNotActive, windowtitle as the first line in the macro subroutine (before the hotkey line) if you want the hotkey to be active except if a window with the specified window title is active. Put #IfWinActive as the last line in the subroutine after the return.

For example, if I want the keypad enter hotkey to be active in all windows except Notepad

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS MACROS.

#IfWinNotActive, Notepad
; hotkey is NumpadEnter
NumpadEnter::
KeyWait NumpadEnter, L
Run C:\Program Files\Macro Express3\meproc.exe /Amacro express macro nickname
return
#IfWinActive


#6 terrypin

terrypin

    Master

  • Members
  • PipPipPipPipPipPipPip
  • 1,480 posts

Posted 10 July 2009 - 07:39 AM

ejs,

I've had Autokey on my To Try List for some weeks, so your post may be enough to spur me into action. I've installed it but I have some studying to do before plunging in. Although we're strictly OT, maybe you or other users like Paul can answer a couple of questions please? Or PM me if you prefer.

Can it display menus? In particular, how close it can get to Stiletto's menu 'bar', which is displayed whenever I move the mouse cursot to the middle top edge of the screen, as shown here:

Attached File  StilettoBar.jpg   45.68KB   7 downloads

(Although the cusor didn't appear in this capture, it was hovering over the black item. The yellow pop-up is reminding me that I can invoke the respective menus ALL with a left click, FILES with aright click, and that I have no menu assigned to a middle click.)

And how reliable is it, especially in terms of activating/focusing program windows and Windows folders please? I have in mind here the problems I described in the thread Intermittent failure - likely reason? at
http://pgmacros.invi...?showtopic=3944 (A very reliable and ultra simple macro for years in Stiletto, but which proves erratic in ME Pro.)

--
Terry, East Grinstead, UK

#7 paul

paul

    Master

  • Members
  • PipPipPipPipPipPipPip
  • 1,032 posts

Posted 10 July 2009 - 08:53 AM

I have done quite a lot of reading on AUtoHotkey but have not used it much yet. From what I see it looks very promising. It's got a very active forum (far busier than this one) and seems to be very powerful. It's a direct descendant of AutoIt v2. And yes, it's got the ability to build GUIs, so you can certainly do menus. In fact, you could almost certainly do pretty well anything Stiletto using AHK.
It's also got the ability to talk directly with COM objects.
Paul

#8 ejs

ejs

    Member

  • Members
  • PipPip
  • 61 posts

Posted 10 July 2009 - 09:29 AM

Terry,

I primarily use Autohotkey to write trivial scripts, just so Autohotkey intercepts the hotkey and then calls the macro I have written In Macro Express. So I cannot answer questions about writing more substantial macros in Autohotkey, and anyway this would not be the right thread for discussing substituting Macro Express with Autohotkey. You should take your Autohotkey questions to the autohotkey forum at http://www.autohotkey.com/forum

how reliable is it, especially in terms of activating/focusing program windows and Windows folders please?

I can answer questions that relate to the interaction between Autohotkey and other programs like Macro Express.

The reliability has been fine, after I learned how to properly write the autohotkey script to avoid certain intermittent problems. Here are some tips:

1) Be careful that you do not define the same hotkey in both programs,

2) Use
SetTitleMatchMode, #
to set whether you want a full match or partial match on window titles
you can put a general setting at the top of the script, to apply to window title matches for the scope of hotkeys. You can also change the type of match within the macro itself, but then I change it back to the general setting at the end of the macro.

3) use the KeyWait command to wait for the hotkeys to be released. The statements go immediately after the hotkey line in the script. For example, if the hotkey is control+alt+c (where Iwas using keys on right side of keyboard), I would put the following two lines in my macro. Otherwise, I was having a problem that the right alt and right control keys would sometimes get stuck in the logical down position.

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS MACROS.

KeyWait RControl, L ; Wait for Right Control to be released.
KeyWait RAlt, L; Wait for Right Alt to be released.

4) the run statement in Autohotkey does not necessarily wait for the new window to appear and then activate that window. So I explicitly use a wait for window command and activate window command. Also, executing the run statement in Autohotkey may temporarily activate an invisible window before activating the real window; this does not cause any problems and is not even apparent to the user until you try to ALT TAB to the previous window and discover that one ALT TAB is not enough. I solved this behavior by getting the name of the active window before executing the run command, activating that window after the run command, and then activating the new window; this resets the window order so the invisible window is no longer the previous window.

THESE ARE AUTOHOTKEY STATEMENTS FOR USE IN AUTOHOTKEY SCRIPTS.
DO NOT USE IN MACRO EXPRESS MACROS.

WinGetActiveTitle, Title; get title of current active window
[Run macro express macro or other program]
SetTitleMatchMode, 3; set window title match to exact match
WinActivate, %Title%; activate the current active window
WinWait new file - metapad; wait for new window to appear
WinActivate; activate the window with the title matching the last title used for a window title function
SetTitleMatchMode, 2; set window title match to partial match
return


#9 terrypin

terrypin

    Master

  • Members
  • PipPipPipPipPipPipPip
  • 1,480 posts

Posted 10 July 2009 - 10:56 AM

Thanks both, appreciate those follow-ups. Appetite duly whetted!

--
Terry, East Grinstead, UK

#10 TsunamiZ

TsunamiZ

    Expert

  • Members
  • PipPipPipPip
  • 373 posts

Posted 27 February 2010 - 10:47 PM

Can it be added as a feature in the next version? I would very much like to have pressing the "keypad enter" play a custom confirmation sound in one of my programs. And I would rather have it doable in Macro Express.