Welcome
KeyBind
1.0.0.0
This plugin makes key binding, key code association and integrated script execution simple. No more memorizing key codes or endless lines of code on differnent pages or seperate objects. With KeyBind, creating key-script assoaciations is simple and quick.
GNU GPL v3
Centauri Soldier
www.AMSPublic.com
CentauriSoldier@AMSPublic.com
AutoPlay Media Studio 8 or higher.
Copyright © 2010 AMSPublic.com
Place the KeyBind folder in your "AutoPlay Media Studio\Plugins\Action" folder.
KeyBind.BindGroup
KeyBind.BindKey
KeyBind.DeleteKeyBinding
KeyBind.DeleteKeyTable
KeyBind.GetKey
KeyBind.GetKeyCode
KeyBind.GetKeyCount
KeyBind.GetKeyName
KeyBind.GetKeyTableCount
KeyBind.GetKeyTableNames
KeyBind.KeyIsBound
KeyBind.KeyTableDoesExist
KeyBind.LoadSettings
KeyBind.OnKey
KeyBind.SaveSettings
KeyBind.SetKeyAtt
KeyBind.UpdateGrid
(number) KeyBind.BindGroup ( | (table) Source Table = tKeys, (string) Key Table ) |
Binds a group of specified keys at once.
(table) The numerically-indexed table containing subtables with each of the keys and their properties.
Note: See KeyBind.BindKey() for specifics on how to create a single key binding.
(string) The name of the key table upon which this action will be executed.
Note: Set this to "" or nil to use the default key table.
(number)
-1 : The specified key is not supported or does not exist
0 : Action was successful
local tKeys = {
{Text="Test Key 1",Description="Here's some text",Key=KeyBind.Key.Tab,Shift=false,Ctrl=true,Alt=false,Script=[[
Dialog.Message("Key Test", "This is a test of the \"Ctrl + "..KeyBind.GetKeyName(KeyBind.Key.Tab).."\" key combination");
--test of multiline
]]},
{Key=KeyBind.Key.l,Script=[[Dialog.Message("Test Key", "This is the l key");]]}
};
KeyBind.BindGroup(tKeys);
(number) KeyBind.BindKey ( | (number) Key = KeyBind.Key.Enter, (string) Text = "Clear Mines", (string) Description = "Used by engineers to clear mines from a battlefield", (boolean) Shift = false, (boolean) Ctrl = false, (boolean) Alt = false, (string) Script = "Dialog.Message(\"Key Test\", \"Hello World\");", (string) Key Table ) |
Binds a single key.
(number) The key code number of the key that will be bound.
(string) This is a short description of the key's action.
Note: Not required.
(string) This is the long description of the key's action.
Note: Not required.
(boolean) Requires the Shift modifier.
Note: Not required. This is false by default.
(boolean) Requires the Ctrl modifier.
Note: Not required. This is false by default.
(boolean) Requireds the Alt modifier.
Note: Not required. This is false by default.
(string) The script that will be executed when the key (or key combination) is pressed.
Note: Not required but recommended.
(string) The name of the key table upon which this action will be executed.
Note: Set this to "" or nil to use the default key table.
(number)
-1 : The specified key is not supported or does not exist
0 : Action was successful
local sCode = "Dialog.Message(\"Success\", \"Mine Cleared\");"
KeyBind.BindKey(KeyBind.Key.M, "Clear Mines", "This ability is used by engineers to clear mines from the battlefield", false, false, false, sCode);
(number) KeyBind.DeleteKeyBinding ( | (number) Key = KeyBind.Key.r, (string) Key Table ) |
Deletes a key binding from a key table.
(number) The key code number of the key that will be deleted.
(string) The name of the key table upon which the action will be executed.
Note: Set this to "" or nil to use the default key table.
(number)
-3 : The specified key is unbound
-2 : The specified key table does not exist or is empty
-1 : The specified key is not supported or does not exist
0 : Action was successful
(number) KeyBind.DeleteKeyTable ( | (string) Key Table = "Input Key Bindings" ) |
Deletes an entire set of keys and their key table at once.
(string) The name of the key table to delete.
(number)
-2 : The specified key table does not exist or is empty
0 : Action was successful
(table) KeyBind.GetKey ( | (number) Key = KeyBind.Key.Four, (string) Key Table ) |
Gets the properties of the specified key.
(number) The key code number of the key whose attributes are being requested.
(string) The name of the key table upon which this action will be executed.
Note: Set this to "" or nil to use the default key table.
(table)
-3 : The specified key is unbound
-1 : The specified key is not supported or does not exist
When the action is successful, a table is returned which contains the key's attributes. The table is indexed by the following.
Key
Name
Text
Desc
Shift
Ctrl
Alt
Script
(number) KeyBind.GetKeyCode ( | (string) Key Name = "Enter" ) |
Gets the key code given the key name.
(string) The name of the key whose code is being requested.
CONSTANT | VALUE | DESCRIPTION |
"LeftMouseButton" | NA | NA |
"RightMouseButton" | NA | NA |
"MiddleMouseButton" | NA | NA |
"Backspace" | NA | NA |
"Tab" | NA | NA |
"Enter" | NA | NA |
"Shift" | NA | NA |
"Ctrl" | NA | NA |
"Alt" | NA | NA |
"Pause" | NA | NA |
"CapsLock" | NA | NA |
"Esc" | NA | NA |
"Spacebar" | NA | NA |
"PageUp" | NA | NA |
"PageDown" | NA | NA |
"End" | NA | NA |
"Home" | NA | NA |
"Left" | NA | NA |
"Up" | NA | NA |
"Right" | NA | NA |
"Down" | NA | NA |
"Insert" | NA | NA |
"Delete" | NA | NA |
"0" | NA | NA |
"1" | NA | NA |
"2" | NA | NA |
"3" | NA | NA |
"4" | NA | NA |
"5" | NA | NA |
"6" | NA | NA |
"7" | NA | NA |
"8" | NA | NA |
"9" | NA | NA |
"A" | NA | NA |
"B" | NA | NA |
"C" | NA | NA |
"D" | NA | NA |
"E" | NA | NA |
"F" | NA | NA |
"G" | NA | NA |
"H" | NA | NA |
"I" | NA | NA |
"J" | NA | NA |
"K" | NA | NA |
"L" | NA | NA |
"M" | NA | NA |
"N" | NA | NA |
"O" | NA | NA |
"P" | NA | NA |
"Q" | NA | NA |
"R" | NA | NA |
"S" | NA | NA |
"T" | NA | NA |
"V" | NA | NA |
"W" | NA | NA |
"X" | NA | NA |
"Y" | NA | NA |
"Z" | NA | NA |
"WindowsLeft" | NA | NA |
"WindowsRight" | NA | NA |
"Application" | NA | NA |
"Numpad0" | NA | NA |
"Numpad1" | NA | NA |
"Numpad2" | NA | NA |
"Numpad3" | NA | NA |
"Numpad4" | NA | NA |
"Numpad5" | NA | NA |
"Numpad6" | NA | NA |
"Numpad7" | NA | NA |
"Numpad8" | NA | NA |
"Numpad9" | NA | NA |
"NumpadAsterisk" | NA | NA |
"NumpadPlus" | NA | NA |
"NumpadDash" | NA | NA |
"NumpadPeriod" | NA | NA |
"NumpadForwardslash" | NA | NA |
"F1" | NA | NA |
"F2" | NA | NA |
"F3" | NA | NA |
"F4" | NA | NA |
"F5" | NA | NA |
"F6" | NA | NA |
"F7" | NA | NA |
"F8" | NA | NA |
"F9" | NA | NA |
"F10" | NA | NA |
"F11" | NA | NA |
"F12" | NA | NA |
"NumLock" | NA | NA |
"ScrollLock" | NA | NA |
";" | NA | NA |
"=" | NA | NA |
" | NA | NA |
" | NA | NA |
"-" | NA | NA |
"." | NA | NA |
"/" | NA | NA |
"`" | NA | NA |
"[" | NA | NA |
"\\" | NA | NA |
"]" | NA | NA |
"'" | NA | NA |
"Function" | NA | NA |
(number)
-1 : The specified key is not supported or does not exist
If the action is successful then the key code is returned
(number) KeyBind.GetKeyCount ( | (string) Key Table ) |
Gets the count of key bindings in a key table.
(string) The name of the key table for which to count the keys.
Note: Set this to "" or nil to use the default key table.
(number)
-2 : The specified key table does not exist or is empty
If the action is successful then the number of keys in the specifed table is returned.
(string) KeyBind.GetKeyName ( | (number) Key = KeyBind.Key.LWin ) |
Gets the key name given the key code.
(number) The key code number of the key whose name is being requested.
(string)
-1 : The specified key is not supported or does not exist
If the action is succesful then the name of the key is returned.
(number) KeyBind.GetKeyTableCount () |
Gets the total number of key tables.
(number)
Returns the number of key tables.
(table) KeyBind.GetKeyTableNames () |
Gets the names of all key tables.
(table)
Returns a numerically indexed table containing the names of the key tables.
If an error occurs or no tables exist then nil is returned.
(boolean) KeyBind.KeyIsBound ( | (number) Key = KeyBind.Key.Tab, (string) Key Table ) |
Determines whether or not a key is bound to a specific key table..
(number) The key code number of the key whose bound status is being requested.
(string) The name of the key table upon which the action will be executed.
Note: Set this to "" or nil to use the default key table.
(boolean)
-1 : The specified key is not supported or does not exist
Returns true if the key is bound to the specifed table and false if it is not.
(boolean) KeyBind.KeyTableDoesExist ( | (string) Key Table = "My Keys" ) |
Detrmines whether or not a specific key table exists.
(string) The name of the key table whose existence is being confirmed.
(boolean)
Returns true if the table exist and false if it does not.
(number) KeyBind.LoadSettings ( | (string) File = "C:\\Test.kbs", (string) Source Key Table = "Custom Key Set", (string) Target Key Table, (string) Decryption Key ) |
Loads key binding settings from a file.
(string) The full path to the key bindings file.
Note: This file will have been created by the KeyBind.SaveSettings() function.
(string) The name of the key table which will be loaded from the settings file.
Note: Set this to "" or nil to use the default key table.
(string) The name of the key table which will adopt the loaded key settings.
Note: Set this to "" or nil to use the default key table.
(string) The string that will be used to decrypt the code portion of the key attributes.
Note: Set this to "" or nil to ignore the decryption process.
(number)
-6 : The specified source table section does not exist, is empty or is corrupt
-5 : File does not exist
0 : Action was successful
KeyBind.OnKey ( | (number) e_Key = e_Key, (table) e_Modifiers = e_Modifiers, (string) Key Table ) |
Executes code for all key tables and key bindings.
Note: This must be placed in the On Key event of the page, dialog, object or project.
(number) The arguement passed to the program when a key is pressed.
Note: DO NOT change this argument.
(table) The arguement passed to the program when a modifier is pressed.
Note: DO NOT change this argument.
(string) The name of the key table which will be referenced when a key or key combination is pressed.
Note: Set this to "" or nil to use the default key table.
This action dose not return any value.
(number) KeyBind.SaveSettings ( | (string) File = "C:\\Test.kbs", (string) Key Table, (string) Encryption Key ) |
Saves key binding settings to a file for later recall.
(string) The full path to where the file will be saved.
Note: The file need not exist prior to saving.
(string) The name of the key table whose key data will be saved.
Note: Set this to "" or nil to use the default key table.
(string) The string that will be used to encrypt the code portion of the key attributes.
Note: Set this to "" or nil to ignore the encryption process.
(number)
0 : Action was successful
If a file error occurs then the error code is returned.
(number) KeyBind.SetKeyAtt ( | (number) Key = KeyBind.GetKeyCode("Enter"), (string) Text, (string) Description, (boolean) Shift = nil, (boolean) Ctrl = nil, (boolean) Alt = nil, (string) Script, (string) Key Table ) |
Sets attributes for an existing key binding.
(number) The key code number of the key whose attributes are being requested.
(string) This is a short description of the key's action.
Note: Not required
(string) This is a long description of the key's action.
Note: Not Required
(boolean) Requires the Shift modifier.
Note: Not required.
(boolean) Requires the Ctrl modifier.
Note: Not required.
(boolean) Requires the Alt modifier.
Note: Not required.
(string) The script that will be executed when the key (or key combination) is pressed.
Note: Not required but rocommended.
(string) The name of the key table upon which the action will be executed.
Note: Set this to "" or nil to use the default key table.
(number)
-3 : The specified key is unbound
-1 : The specified key is not supported or does not exist
0 : Action was successful
(number) KeyBind.UpdateGrid ( | (string) Object = "Grid1", (boolean) Include Description = false, (number) ResizeMode = GVS_DEFAULT, (string) Key Table ) |
Displays key binding settings in a grid object.
(string) The name of the grid object upon which the key data will be displayed.
(boolean) Whether or not to include each key's desciption attribute on the grid.
(number) How each column in the grid will be resized.
Note: Set this to nil to use the default setting.
CONSTANT | VALUE | DESCRIPTION |
GVS_DEFAULT | 0 | Use the default behavior which is to make the column as small as it can be while still accommodating all of its text. (Default) |
GVS_HEADER | 1 | Make the column resize according to the size of the text in the header cell. |
GVS_DATA | 2 | Make the column resize to the widest non-header cell in the column. |
GVS_BOTH | 3 | Mixes both GVS_HEADER and GVS_DATA using whichever is the widest in the column. |
(string) The name of the key table to load into the grid.
Note: Set this to "" or nil to use the default key table.
(number)
-8 : Object does not exist
0 : Action was successful
Copyright © 2010 AMSPublic.com
This File Was Generated With AMS ActionFile Editor