keyboard macros don't work with maco keys

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
Jack Rosenbloom

keyboard macros don't work with maco keys

Post by Jack Rosenbloom »

Hi,

I recently customized Zeus by binding lua files to the backspace and home key. Now when I attempt to create a keyboard macro which includes these two keys, the keyboard macro doesn't work. Below is the macro Zeus create when I had it record the keystokes

test<backspace><backspace><backspace>


function key_macro()
screen_update_disable()
print("test")
()
()
()
screen_update_enable()
screen_update()
end

key_macro() -- run the macro


I hope there is a simple solution to this since I am finally happy with the home and backspace behavor but I use keystoke macros all the time.

Thanks,
Jack
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Jack,

Unfortunately this is a known problem/limitation with the Zeus macro scripting engine :(

Basically the Zeus script record only knows how to record keyboard functions and has no idea how to record (therefore invoke) keyboard keys bound to macro scripts.

I will have a look into this bug one more time, but from what I recall of the last time this was investigated, there is no easy fix as it is a basic limitation of the Zeus scripting design :(

At this time the only work around is to edit the script using the Macro, View Source menu and manually touch up the macro script.

Jussi
Guest

Post by Guest »

By manually editing, do yu mean copying the contents of the file containing the macro into the file containing the keyboard macro?

Jack
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Jack,

There are several things I would do.

If the is macro being written to be a permanent macro then naturally I would edit the script and copy in the macro text.

Alternatively you can use a feature of the scripting language to include the macro. For example the comment.lua macro has an example of how Lua includes and runs an external macro file:

Code: Select all

dofile ("commentText.LUA")  -- Lua #include file

function key_macro()
  -- this macro only works for writable documents so do a check
  if (dofile ("AS_NotDoc.LUA") == 1) then return end
But if the macro is of the throw away variety then there are two things I would try and do.

Firstly I would attempt to train myself to record the macros without using the problematic key. For example at it's simplest the backspace key is no different to the left arrow key and the delete key while the tab key is a lot like the move to next word key.

My second approach would be to have alternative bindings to the problematic key and then use these bindings during macro recording process. For example lets say the Backspace key is bound to a macro script and hence it will not record. I would bind the Alt + Backspace keys to the default Zeus Backspace function while leave the Backspace key bound to the macro script. With these extra binding all I have to do is remember to use the Alt + Backspace key while recording a macro.

I clearly remember my first efforts at recording keyboard macros for Zeus. I would record the throw away macros in absolute terms, based on the first line that required changing. Naturally when the macro was replayed on the next line it would not always work :(

But after some time and many broken macros I eventually di manage to train myself to make a conscious effort to define macros in relative terms (i.e. second word from the end of line, three characters in from the start of line etc) and as a result my throw away macros hardly ever go wrong :)

I guess my point is that while the the current limitation is unfortunate and obviously disappointing, it really should not be a show stopper :)

Jussi
Guest

Post by Guest »

Hi Jussi

Thanks for the reply. I only have two problematic keys, backspace and home. The home is great for making "relative" macros. I like your 2nd approach. It should solve the problem.

Thanks!
Jack
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Jack,

I had another look at this bug and my initially reaction was it this would be a very difficult bug to fix, the same reaction I had when I first look into this bug some years ago :(

But after a bit more thought, I have come up with another way of tackling this problem and with a bit of luck this new approach should fix this bug once and for all :)

Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

This bug should now be fixed in the latest Zeus for Windows release.

Jussi
Post Reply