Beginner Builder series 75% done! will probably never be finished. :(

Saturday, December 12, 2009

Skeys: Specialize your Special Keys!


A while ago, I bought a keyboard to use with my netbook, and when it came it had many function keys that I was not used to ("Special" keys, if you will), because I had not used a keyboard with special keys for several years (certainly not since learning Autohotkey.) As I tested them out, I found that some of them opened a web browser that I would rather not use, or that brought up an e-mail client instead of Gmail (which I use), or even that the volume + and - seemed to be swapped. So I decided to do a little coding and rebind it to what I wanted. That was easy enough, but then I thought, "What if I wrote a program for this?"

Skeys (pronounced like "skiis") is the result of me itching to code and getting a new piece of hardware. It's actually been in the works for quite some time, even "Stable", per se, but I haven't written about it or posted it on FreewareWire Software for several reasons which I will not name. Anyway, I think it should be ready now.


Setup.
Before you can jump in to using your special keys, you have to figure out which ones you want Skeys to use and which key is which. When I was thinking about how to do this best, I was a tad befuddled at first. Of course I could name them things like "E-mail" or "Web browser", but where's the fun in that? (Plus, I wasn't sure if every single keyboard had all those keys do the same thing.) So instead, I took a different approach for identifying the keys you want. On the "Setup Screen", there are 18 buttons that all have "Use This Key" on them. When you press one of the special keys, the button for that key will change to "!!!Use This Key!!!" letting you know that that is the button for that key.

In addition, I also threw in an "Autocheck" feature; if "autocheck" is on, when you press one of the special keys, it will automatically press down the button too, meaning that you can configure which keys you want in under 20 seconds, easily.

The last feature for setup is Nicknaming. Again, naming keys "E-mail" or "Play/pause" is so droll, so I thought "Why not let the user be able to name them?" So when you find which button is for the key you want to use, right click it, and you assign that key its "Nickname", which will make it 100 times easier to identify.


The Heart of Skeys.
Finally we've come to the heart of Skeys. I wanted to make Skeys straightforward for the less computer-savy, but functional enough to be customizable to the fullest potential. The reason that you check buttons and whatnot is because I was writing Skeys and I got to its "heart", and I thought "Why should the user be worried about 18 different keys when they maybe just want to use one?" So using the Setup screen, you can handpick which keys you want to use, and then from then point on, those are the only keys you have to worry about.

So anyway, you can select the keys that you picked in the setup from a drop down list, and every key will either have the Nickname that you gave it (aha! See? Isn't it handy already?) or it's "reference code". [Every "Special key" has a reference code that is "SC" followed by three letters/numbers.] When you pick one of the keys from the list, you can then add actions that will be performed when the key is pressed. And
My.
Goodness.
There are a ton I threw in. I wanted it to be completely feature filled, so here they are:
  • Open File/Program
  • Power Function
    • Logoff
    • Switch User
    • Standby
    • Hibernate
    • Hibernate/Standby [uses Standby as a backup if Hibernation is turned off]
    • Shutdown
    • Restart
  • Send keystrokes
    • Send
    • Paste
  •  Volume Function
    • Mute
    • Unmute
    • Toggle mute
    • Up
    • Down
  • Popup
    • Center
    • Bottom right
    • Bottom left
    • Top right
    • Top left
  • Skeys
    • Show Skeys
    • Show Skeys setup
    • Disable Skeys
    • Disable this hotkey
    • Exit Skeys
  • Wait
 Most of those are self-explanatory and don't have any configurable options, but others also do, which I will talk about now.
-OPEN FILE/PROGRAM: Choose whatever file/program you want to open/run. You can either manually type in the path to the file, or click the ellipses button and navigate there. Please note that in the "Select File" dialog, you may choose either "Programs (*.exe)" or "All Files (*.*)" from the drop down list below the filename field.
-"SEND"/"PASTE" KEYSTROKES: Under the submenu of "Send keystrokes", "Send" will "type" whatever you want. The only difference between "Send" and "Paste" is that "Paste" types whatever you have specified instantly, like pasting from the clipboard, while "Send" types one character at a time. I'll talk more about this later, because it's so massive!
-"WAIT": Simply waits, doing nothing, forever however long you specify. The time is in seconds, but is accurate to milliseconds (0.001 seconds). Don't go below that accuracy, though (ie "1.000000000001"), because that is just beyond the limitations of Autohotkey (and it's just plain ridiculous).



Sending keystrokes.
I only make this a separate section because it is so completely massive, and I am quite proud of it. You can send just about anything in terms of keystrokes, every single key on the keyboard from "A" to "Z" and from "1" to "0". But wait, there's more! You can also pick the "Other" keys, ones that aren't as straightforward.
-COMMON: Basically standard keys that have one function, and the arrow keys. Examples: Enter, Escape, Tab, Delete, Space, etc.
-F KEYS: All F keys, up to 24. Even if you don't have a keyboard that has 1-24, you can still use 13-24.
-NUMPAD: All keys and variations on the numpad. Note that, in terms of textual output, a "Numpad 7" is the same as a regular "7". The difference is only if a game uses the Num keys, or such. Also note that these options are uneffected by Numlock.
-TOGGLE: Contains the "Locks" and the "Modifiers". Although it should be obvious "Shift down" will act as though Shift has been pressed down until "Shift up" is indicated. A regular "Shift" will stay down only until the immediate following character, such as "{Shift}rs" will produce "Rs" (if capslock is off.)  A regular "Shift" will act like the user pressed and release Shift before sending the next key. Essentially, sending something like "{Shift}rs" is the same as sending "{Shift Down}{Shift Up}rs". (Thanks to Tony for catching that for me!)
-BRACES: (or brackets....) Because braces/brackets are used for "other" keys, they also become "other" keys themselves. In order to use a brace, just put it inside braces! Example: {{}Hi there!{}}     will result in        {Hi There!}

The coolest part about the key sending function is that it's very well organized. There is a huge menu with sub-menus and options that you can press, but you can also just get the gist of most keys and be able to type them in yourself. For example,
Enter = {Enter}
F2 = {F2}
Numpad - = {Numpad -}
If that isn't simple, I don't know what is! But if you're ever confused about what a key should be, the menu is there.




Multi-action.
While writing Skeys, I thought "You know what would be even cooler than Skeys being able to do one of those things? It being able to do more." Every single key in Skeys has not only one command it can execute, but a list of commands. For example, you can make one key (1) mute the volume, (2) send "I love FreewareWire!", and (3) send the computer to standby, in that order. You can add (theoretically) as many commands as you want, and Skeys will execute them from top to bottom.
But please let me make myself clear: Skeys is not meant to execute a long string of commands, and therefore is not supported in doing so. Please don't complain to me if you have a list of 20 commands that aren't being executed right.


Disabling Skeys.
If you want to temporarily disable a hotkey, go to the Skeys main window (NOT the Setup), and just uncheck the "Enabled" box for that key. The effect will be immediate, and the Special key will do its original intention outside of Skeys.

If you want to disable ALL of Skeys, Double click on the tray icon, or right click the tray and click "Enabled". If Skeys is disabled, the icon will be greyed out, and all of the Skeys will do their original purpose outside of Skeys. In other words, when Skeys is disabled, Special keys will act as if Skeys is not even running.

If you want to make a special key do nothing, mark in in Setup, then just check its "Enabled" box in the main window without adding any actions. This will make Skeys take over that key from its original purpose, but then give it 0 commands to do, meaning it will do nothing.

Icing on the cake.
On top of all that, there are options that I included to make Skeys as streamlined as possible.
-Start with Windows: If you get to the point where you love Skeys so terribly that you need it all the time, there's an easy menu option for that.
-Start Disabled: If for some reason you don't want Skeys to be active when it starts, you can make it start disabled.
-Skip Setup: This is where it really starts to make the experience great. Once you get the feel of Skeys and you routinely use the same special keys, you can make Skeys skip the "Setup" screen, meaning it will go straight to the "heart" window.
-Start in tray: Maybe you are so used to Skeys that you don't even need to see the configuration screen. That's ok, check this option, and it will will skip both the Setup screen and the Heart screen and will sit quietly in your tray.


Final notes.
Just a few things that I want to say.
-PORTABLE: Skeys is portable, in that it does not need any external files and it leaves nothing on your computer. However, certain things, like launching a program with a Skey, will not work because the path is not relative.
-Open Source: Yay for freedom!
-Untested/Unstable: I've tested Skeys to an extent, but not heavily. There's already things that I know that don't work amazingly well, like the popups.
-Messy code: To be honest, I am a messy code writer and it's been a while since I actually wrote Skeys, so the code is very messy. (Hopefully a few programming courses next semester will whip me into shape.)

Acknowledgements.
Just a few people I want to thank.
Xoxide - For making a freakin sweet, glowy keyboard to write Skeys.       
Titan - For his ABSO-FRIKKIN-LUTELY A-MAZING anchor script, whichout which my programs could never be resized.
Yook - For his AMAZING Balloontip script, letting you display a balloon any current control.



That's about it. I really love Skeys, possibly the most out of all the programs I've written just because of how limitless it is (and because, honestly, I'm really proud of the keystroke sending.) I hope if you decide to take a look at Skeys that you'll enjoy it. It's a fun little app that I believe has great potential.

[NOTE: Over the last two days, I've compiled and recompiled more times than I can count because I keep finding problems that I thought I had fixed a long time ago. So what that means to you is, Skeys is way less stable than I thought, so if you find an error (or errors), don't be surprised, but also let me know. PLEASE let me know. I really want to make it the most usable it can be, and I can only do that if I fix the bugs.]

Visit FreewareWire Software Downloads page for Skeys v1.1

4 comments:

  1. Are you aware that there is a Windows system file called skeys.exe? http://www.processlibrary.com/directory/files/skeys/ says, "skeys.exe is a process which belongs to the Microsoft Windows Operating System and provides the Serial Keys Utility."

    ReplyDelete
  2. Vic,

    I learned about that after naming Skeys.....as much as I hate the fact that Microsoft beat me to the punch, I think I'm going to keep the name, just because I think it rolls off the tongue nicely.

    -Jon

    PS - I took a brief look at your blog, and also noticed that you mentioned Skeys on there. I appreciate the mention. :)

    ReplyDelete
  3. I'm in need of something, can you code it, please please ? =)
    I have this keyboard: http://www.cellution.com.br/produto.php?id=1691

    All I want to do is to map some of the buttons at left (play/pause and stop, just below the green round button) to left and right mouse button (emulate mouse click with the keys).

    Can be done?

    ReplyDelete
  4. I have an MSI computer with some special buttons on it.
    http://www.gizmocrave.com/wp-content/uploads/2011/10/MSI-GT780DX-1.jpg (the orange lights at the top of the keyboard.)
    Normally these are controlled by a little program called s-bar. (http://drivers.softpedia.com/get/Other-DRIVERS-TOOLS/MSI/MSI-X370-Notebook-S-bar-2-0-Utility-2001102251.shtml)

    But it doesn't work with sKeys. Is there any way you could fix that?

    ReplyDelete