Author Topic: Key Macros plugin  (Read 25072 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #15 on: January 24, 2007, 05:37:05 pm »
Hello,

Yes, I'm using the supplied KeyMacs project. On reading your reply,
I worked a bit with it again and got past the Windows preproc
problems. I had to do this (including windows.h and a couple of defines:

// ----------------------------------------------------------------------------
//  MSWrunmacro.cpp
// ----------------------------------------------------------------------------
// RCS-ID: $Id: MSWrunmacro.cpp 15 2007-01-14 05:32:30Z Pecan $

#if defined(__WXMSW__)
 // headers for MSW here

#ifdef wxUSE_UNICODE
#define _UNICODE
#define UNICODE
#endif
#include <windows.h>
Also I had to add the search path to MinGw/Include to the project.

However... I think we get a very direct dependence on MinGw (going
past the wxW layer).

When the compiler continues, I get some other errors (below). They
all concern the PageUp and PageDown keys, where different defines
have the same value, in the switch case.

:: === KeyMacs-MSW-plugin, default ===
C:\wxWidgets-2.8.0\include\wx\wxprec.h:28: warning: "WX_PRECOMP" redefined
:9:1: warning: this is the location of the previous definition
cmdkeytextctrl.cpp:236: error: duplicate case value
cmdkeytextctrl.cpp:221: error: previously used here
cmdkeytextctrl.cpp:237: error: duplicate case value
cmdkeytextctrl.cpp:222: error: previously used here
cmdkeytextctrl.cpp:321: error: duplicate case value
cmdkeytextctrl.cpp:320: error: previously used here
cmdkeytextctrl.cpp:323: error: duplicate case value
cmdkeytextctrl.cpp:322: error: previously used here
:: === Build finished: 8 errors, 2 warnings ===
OK
// Arst


I see you're running wxWidgets 2.8.0. I have no confidence that KeyMacs will work with this newest wxWidgets. I've never tried it, and I've never compiled either KeyMacs or CodeBlocks using 2.8.0.

Currently KeyMacs is only supported on wxWidgets 2.6.3

However, KeyBinder had a problem like this with 2.8.0 that was fixed by TimS.
I'll look at that fix and try it with KeyMacs.
« Last Edit: January 24, 2007, 05:39:11 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #16 on: January 24, 2007, 06:03:55 pm »
Code: [Select]
   #if not wxCHECK_VERSION(2, 8, 0)
case WXK_PRIOR:     res << wxT("PgUp");     break;
case WXK_NEXT:      res << wxT("PgDn");     break;
   #endif

WXK_PRIOR and WXK_NEXT should have guards around them for wxWidgets 2.8.0


Offline arst

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Key Macros plugin
« Reply #17 on: January 25, 2007, 12:11:15 am »
Hello again,

Now I've compiled it and ran it too. It goes OK, the submenu showed
up under Plugins and I recorded some macros. Some problems with
quote key (Shift+2) generating @ instead after a while.

I had to modify a couple of extra files in the same manner (defining
UNICODE, includingwindows.h and the gueards for wxw 2.8.0).
See attached file.

OK,
Ats

[attachment deleted by admin]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #18 on: January 25, 2007, 12:43:57 am »
Hello again,

Now I've compiled it and ran it too. It goes OK, the submenu showed
up under Plugins and I recorded some macros. Some problems with
quote key (Shift+2) generating @ instead after a while.

I had to modify a couple of extra files in the same manner (defining
UNICODE, includingwindows.h and the gueards for wxw 2.8.0).
See attached file.

OK,
Ats

Thanks arst

What do you mean by:
"Some problems with quote key (Shift+2) generating @ instead after a while."

My quote key is no where near Shift+2. I don't understand. My Shift+2 is an @. Could you explain a little further?

Did the KeyMacs menu item show up under your context menu (right mouse)?
« Last Edit: January 25, 2007, 12:51:07 am by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #19 on: January 25, 2007, 07:31:36 pm »
KeyMacs is a Code::Blocks plugin providing the user an ability to group sequences of keystokes as a macro (KeyMac). The KeyMac can be executed by either the main Plugin menu, a menu command key, or the context menu.

Update: KeyMacs v 0.3.8

http://savefile.com/files/441146


changes:
Code: [Select]
// ----------------------------------------------------------------------------
//  Commit  0.3.8 2007/01/25    Publish
//           6) Scroll listCtrl "New" Untitled item into view.
//           7) Fixes by arst for wxWidgets 2.8.0
//           8) Disallowed Shift-singleChar as command key. Must start with
//              Ctrl- or Alt- if Shift- is used.
// ----------------------------------------------------------------------------

Help entry (Wiki):

http://wiki.codeblocks.org/index.php?title=KeyMacs_plugin
« Last Edit: January 25, 2007, 10:11:28 pm by Pecan »

Offline arst

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Key Macros plugin
« Reply #20 on: January 25, 2007, 09:59:45 pm »
Hello again,

I had a break from the forum. Anyway, I have a swedish keyboard and
the " character (I call it quote) is located at Shift-2. And @ at the same
place (Alt qualified). I only had problems with that particular key.

For Windows headers, it saw the other post, yes WxWidgets includes
Windows.h in WrapWin.h. Maybe that is a much  better way to go,
since I had to wrestle around a bit to get it working (when including
directly from MinGw from KeyMacs).

WxW should works with both GCC and MSVC, so it relies on a windows.h
not shipped with it.

On the application level, there is usually no need to worry about this,
since WxW hides most of the platform issue. Ideally.

Well well...

// Arst



 


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #21 on: February 01, 2007, 05:01:37 am »
KeyMacs is a Code::Blocks plugin providing the user an ability to group sequences of keystokes as a macro (KeyMac). The KeyMac can be executed by either the main Plugin menu, a menu command key, or the context menu.

Update: KeyMacs v 0.3.12

http://savefile.com/files/457081


changes:
Code: [Select]
//  Commit  0.3.12 2007/01/31   Publish
//           9) Automatically paste keymac to edit window when user double
//              clicks on canned {keymac} in help window.
//         10) Re-instated "force mouse back into window" for context menu
//              Removed braces from around incorrect help caned keymacs
//              Correct some spelling errors in help entry
//    11) Fixed: When another plugin is disabled, menu rebuild is Disconnecting event hooks.
//    12) Fixed: StopRecording event not creating the Scratch macro for playback.

Help entry (Wiki):

http://wiki.codeblocks.org/index.php?title=KeyMacs_plugin
« Last Edit: February 01, 2007, 02:25:12 pm by Pecan »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6610
    • My Best Post
Re: Key Macros plugin
« Reply #22 on: February 01, 2007, 06:30:15 am »
I will work on getting it to compile with wxWidgets 2.8, and try to do the precomp stuff also.
But, I won't be doing any testing of it, past compile and link.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #23 on: February 01, 2007, 02:23:43 pm »
I will work on getting it to compile with wxWidgets 2.8, and try to do the precomp stuff also.
But, I won't be doing any testing of it, past compile and link.

Tim S

Thanks Tim, I really appreciate that.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #24 on: February 08, 2007, 11:51:01 pm »
KeyMacs is a Code::Blocks plugin providing the user an ability to group sequences of keystokes as a macro (KeyMac). The KeyMac can be executed by either the main Plugin menu, a menu command key, or the context menu.

Update: KeyMacs v 0.3.15

http://savefile.com/files/526808


changes:
This .zip contains the KeyMacs.dll and libKeyMacs.so for CodeBlocks nightly build of Feb. 7, 2006
Simply copy the correct library to .../share/codeblocks/plugins/
Then copy KeyMacs.zip to .../share/codeblocks/
Code: [Select]
// ----------------------------------------------------------------------------
//  Commit  0.3.15  2007/02/8   Publish
//          13) Fixed GTK secondary crash when CB thinks there's no BuildMenu implemented.
//              Don't know why menu appears twice after a prior CB crash. But this occurs
//              only after a testing or debugging crash.
//          14) Fixed GTK KeyMacs rename crash, and GTK listCtrl focus/selection
//          15) Lost fixed item 0.3.12 above. Fixed it again.
// ----------------------------------------------------------------------------

Help entry (Wiki):

http://wiki.codeblocks.org/index.php?title=KeyMacs_plugin
« Last Edit: March 02, 2007, 12:44:08 am by Pecan »

Offline Mad Scientist

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Key Macros plugin
« Reply #25 on: March 03, 2007, 08:15:01 am »
*how about an option to enable or disable macros from activating other macros

*also changing it so when modifier keys are used to activate a plugin they do not need to be released for the macro to be used

eg currently if you use Alt - 0 you must release both the alt key and the '0' key where from what I have seen with linux and windows when a modifier key is pressed it does not need to be released eg you press down Alt - 0 and release '0' to activate the key. This would be nice for macros to be done quickly in succession.

Otherwise great plugin should nvr have a missing ")" or "}" again  :D

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #26 on: March 03, 2007, 04:05:50 pm »
*how about an option to enable or disable macros from activating other macros

*also changing it so when modifier keys are used to activate a plugin they do not need to be released for the macro to be used

eg currently if you use Alt - 0 you must release both the alt key and the '0' key where from what I have seen with linux and windows when a modifier key is pressed it does not need to be released eg you press down Alt - 0 and release '0' to activate the key. This would be nice for macros to be done quickly in succession.

Otherwise great plugin should nvr have a missing ")" or "}" again  :D

I'll put 'em on the todo list.

But I'm not sure this can be done:
Quote from: Mad Scientist link=top's ic=4681.msg41361#msg41361 date=1172906101
*how about an option to enable or disable macros from activating other macros
I'd have to parse the user's keymac text to determine if it's invoking another keymac, a menu item, a secondary KeyBinding, etc. That's a big piece of work. I'll see what can be done though.

Re: Repeating keymacs:
For now, when you want to repeat a keymac quickly in succession, eg. Alt-0, hold the Alt key and kit 0 as many times as you want, then release the Alt.

The keymac will then repeat rapidly.

Thanks for the suggestions.
« Last Edit: March 03, 2007, 04:29:14 pm by Pecan »

Offline Mad Scientist

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Key Macros plugin
« Reply #27 on: March 03, 2007, 09:04:41 pm »
I was just thinking if you can send it you could use a null character( '\0' ) to signify the end of a macro and have it removed after it is detected.

Also I was trying to do this macro:{ENTER}{{}{ENTER}{ENTER}}{}{UP}{SPACE 2} but every 4th line it adds a tab in when used multiple times in a row and I can't figure out why.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #28 on: March 03, 2007, 09:51:28 pm »
I was just thinking if you can send it you could use a null character( '\0' ) to signify the end of a macro and have it removed after it is detected.

Also I was trying to do this macro:{ENTER}{{}{ENTER}{ENTER}}{}{UP}{SPACE 2} but every 4th line it adds a tab in when used multiple times in a row and I can't figure out why.

That macro is mis-configured. What is "}{}" supposed to be. Isn't that supposed to be {}} ?

Using a hot key of Alt-Shift-I, I cannot get it to show a tab.
What hotkey are you using?

This is what I get when I hit Alt-Shift-I 5 times.


For me, it seems to work. Could you show us what it's doing on your end.
Also, what OS and version are you using.
« Last Edit: March 03, 2007, 09:58:27 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Key Macros plugin
« Reply #29 on: March 03, 2007, 10:09:16 pm »
I was just thinking if you can send it you could use a null character( '\0' ) to signify the end of a macro and have it removed after it is detected.

Also I was trying to do this macro:{ENTER}{{}{ENTER}{ENTER}}{}{UP}{SPACE 2} but every 4th line it adds a tab in when used multiple times in a row and I can't figure out why.

I take that last message back. I seem to be getting the tab event even when I enter that macro sequence by hand.

The editor thinks an "enter" after a "{" should be "tabbed" outward. Must be some .cpp syntax thingie.



Anyway, you can correct the situation by using some judicious {home}'s or +{TAB}'s (shift-tabs). Eg:,
Code: [Select]
{ENTER}{{}{ENTER}+{TAB}{ENTER}{}}{UP}{SPACE 2}

EDIT: 4:17 PM
 It even happens on a .txt file. Also be aware that this editor has some key sequences that you cannot override. They're compiled in.

For example, one user found that Ctrl-W will always, when not using a recent KeyBinder,  close a window even though s/he defined it to be otherwise in a macro/menu item.
« Last Edit: March 04, 2007, 01:43:24 am by Pecan »