npKeys plugin

About this plugin

This plugin allows you to add system-wide Hotkeys to your publication. A hotkey in Windows is a key combination which invokes a specific action. You can often use "CTRL + S" from an application to save a file. However, a system-wide hotkey allows you to invoke a custom action from anywhere. Your application doesn't have to be in the foreground or even visible to receive the hotkey events.

For example if your publication is executed in the system tray, the Hotkeys continue available for your publication. This plugin allow you to add any number of Windows Hotkeys, controlling it by their key combination (or shortcut) or by the Hotkeys ID's. Also you can prove that a Hotkey is valid and available before try to register it, or change one Hotkey for another if neccesary.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npKeysAdd

Add a new Windows Hotkey to your publication. Dont care about the spaces in Hotkey, also the keys combination are not case sensitive. This "CTRL+ALT+S" is equivalent to "ctrl + alt + s".

In addition to the regular hotkeys, you can also register some other extended keys to notify your publication. To register these extended keys use exactly the name (case insensitive) of the keys provided in the below list:

The result variable store the Hotkey ID that you can use later with other plugin actions. The result variable contain "0" if an error occurr, and, in this case, the [LastError] have information about the error.

↑↑

npKeysChange

Change a previosly stablished Windows Hotkey using the Hotkey ID to do this. So provide the old Hotkey ID and the new Hotkey combination (or shortcut) in order to do the change.

The result variable store the Hotkey ID that you can use later with other plugin actions. The result variable contain "0" if an error occurr, and, in this case, the [LastError] have information about the error.

↑↑

npKeysRemove

Remove a previosly registered Windows Hotkey using their key combination or shortcut. For example, if you register the "CTRL + ALT + S" Hotkey, you can use this key combination also to remove the Hotkey. The result variable store "True" if the Hotkey is removed or "False" when not.

Note that is not neccesary to remove the registered Hotkeys when you close your publication: the plugin make this for you. But is possible to do because maybe you need for something.

↑↑

npKeysRemoveById

Remove a previosly registered Windows Hotkey using their ID. For example, if you register the "CTRL + ALT + S" Hotkey you get an ID as result. You can use this Hotkey ID to remove the Hotkey. The result variable store "True" if the Hotkey is removed or "False" when not.

Note that is not neccesary to remove the registered Hotkeys when you close your publication: the plugin make this for you. But is possible to do because maybe you need for something.

↑↑

npKeysClear

Just clear all previosly registered Hotkeys. However note that is not neccesary to clear the registered Hotkeys when you close your publication: the plugin make this for you. But is possible to do because maybe you need for something.

↑↑

npKeysIsValid

Test a Hotkey key combination or shortcut is a valid Hotkey to be register. The result variable store "True" if the Hotkey is valid or "False" if not. Please note that a valid Hotkey maybe cannot be registered: because are not available. See also npKeysIsAvailable.

↑↑

npKeysIsAvailable

Test a Hotkey key combination or shortcut is an available Hotkey to be register. The result variable store "True" if the Hotkey is available or "False" if not. Please note that an invalid Hotkey ever is unavailable to be register. See also npKeysIsValid.

↑↑

npOnKeyPress

Set a subroutine to be executed when a registered Windows Hotkey is pressed. The Hotkey ID variable store the ID of the Hotkey that fire the event. The Hotkey shortcut variable store the key combination or shortcut that fire the event.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑