View Single Post
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#695
Hello again, yes, time for another Pierogi update to extras_devel.

This one is a bit more involved than most. I've been pulling together bits and pieces of work on a macro system, and I think I've finally got it into enough shape to at least let folks play with it. Be Warned: this code is hot off the text editor, and likely to be riddled with bugs. (Also, the UI is just terrible!) There is, as yet, no in-app documentation for the macro system, so let me give a short overview (some example pictures attached at the end of the post):

- Commands within a macro are executed in sequence. (No conditionals, no loops. I suppose those could be added later...)

- Only three types of command are available:
  • Keyset Selection: switch to a chosen keyset. (During the execution of the macro, Pierogi will switch from the user's current keyset to this one, but will revert back to the original keyset after the macro completes running.)
  • Key Commands: have the macro "press" a chosen key. (Note that I am not doing any filtering on keys here -- if you choose a key that doesn't exist in the current keyset, Pierogi will simply do nothing when executing that command.)
  • Pause Commands: have the macro wait for a specified number of seconds.

- Each macro can be given a name.

- Each macro can be assigned to a user-defined button in the interface. (Currently, there is just one "User" panel with six user-defined buttons, that I've added to the "Universal" panel set... Still needs work here! )

- Each macro can be assigned to a keyboard key. (I'm working with an American N900 here, so I'm using the English keyboard. Hopefully, this can be extended to other keyboards in the future...) Any Pierogi panel that is not already using the keyboard for another purpose should allow you to execute macros by pressing their associated key (which means that most of them will).

- Sets of macros are collected into "macro packs". (Or, at least, they will be. I'm still working on this. Right now, all user-defined macros are being collected into the "User Defined Macros" pack.)

The user interface for all this is seriously bad (as you can probably tell from the screenshots attached below). The general concept is this:

1) You first go to the "Edit Macro Contents" panel (in the new "Macro Panels" collection),
2) Click the "Macro" button to bring up the "Select Macro" dialog box,
3) Click "New" to create a new macro. (You can give it a name here, and assign it to one of 6 buttons or one of 26 keys.)
4) You're sent back to the "Edit Macro Contents" panel. Now, you can click "Command" to add a new command to the macro.
5) Now here's the most annoying part -- the top button in the "Command Choices" dialog box lets you select from the three different types of command. For the "select keyset" or "select key" commands, you then have to go through a huge combo box of options to find the one you want. I've tried to break the "select key" commands into a handful of categories to make the job easier, but it'll probably take a bit of effort here to find exactly what you want.
6) Continue adding commands as you wish. (You can click on a command to delete it, or move it up or down in the list.)
7) Finally, you can hit the "Run" button to test out your macro.

As I've mentioned above, this is fresh, relatively untested code, so please be gentle with it.

Along with the "User Defined Macros" pack, I've added one other hard-coded macro pack (following a suggestion from Pierogi user Leo Pacman). Quite some time ago, phone companies began associating keys on the phone keypad with letters from the alphabet (associating a, b, and c with 2, d e and f with 3, etc.); today, most cell phones support text entry on a 10-digit keypad using this system, which is generally known as a "multitap" keyboard. As it turns out, quite a number of televison sets (and probably other devices) support this as well, through their infrared remotes. So, I've thrown together a set of macros to implement a "reverse multitap" keyboard -- e.g., press the "e" key, and Pierogi will emit two "3"s. Press "j", it will emit one "5". For "s", it will emit four "7"s, etc. Hopefully, this will let you use an actual keyboard for any device that supports multitap. If you'd like to try it out, you can enable the "Reverse Multitap Keyboard Macros" in the Preferences screen accessible from the menu.

In any case, I'm happy to finally have some sort of IR keyboard to offer folks!

And also in this release, there are some minor tweaks to the Creative, Grundig, and RCA keysets, as well as a bugfix to the RCA protocol.

Happy Macro-ing, and again, please inform me of any and all bugs you run across!
Attached Images
     
 

The Following 5 Users Say Thank You to Copernicus For This Useful Post: