summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI/m_hotkey.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ExternalAPI/m_hotkey.h')
-rw-r--r--plugins/ExternalAPI/m_hotkey.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/plugins/ExternalAPI/m_hotkey.h b/plugins/ExternalAPI/m_hotkey.h
new file mode 100644
index 0000000000..1af34b4342
--- /dev/null
+++ b/plugins/ExternalAPI/m_hotkey.h
@@ -0,0 +1,67 @@
+#ifndef H_HOTKEY_H
+#define H_HOTKEY_H
+
+//hotkey struct
+ typedef struct{
+ BOOL isShift; //determines if hotkey uses shift
+ BOOL isCtrl; //determines if hotkey uses control
+ BOOL isAlt; //determines if hotkey uses alt
+ UINT vkCode;
+
+ }KEYHASH,*PKEYHASH;
+
+ //struct passed to HKS_GET_NAME_BYHASH the result of calling it will be stored in char* name
+ typedef struct{
+ char* name; //pointer to buffer where the result will be stored
+ size_t bufferlen; //size of the buffer
+ }GETNAMEWPARAM;
+
+ /*this below are registred miranda services and should be called by CallService */
+
+ /* this funtion registers new hot key function, function must be registred as miranda service
+ lParam = (KEYHASH*) hotKeyDefinition
+ wParam = (const char*)ServiceName
+ returns true on success and false if fails */
+ #define HKS_REGISTERFUNCTION "mhotkeyregister"
+ /* unregisters function as hot key function
+ lParam = (KEYHASH*) hotKeyDefinition /search function by it's hotkey combination
+ wParam = NULL
+ and if
+ lParam = NULL
+ wParam = (const char*) functionName //search function by it's name
+ returns if function was propertly deleted returns true else returns false */
+ #define HKS_UNREGISTERFUNCTION "mhotkeyunregister"
+
+ /*
+ Updates hotkey to the specific function (if another function use this hot key it'll be assigned to this
+ and that function will be unregistred as hotkey function)
+ wParam = (const char*) FunctoinName // name of the function you want to update
+ lParam = (KEYHASH*)newHotKey
+
+ returns: true on success and false on failure
+ */
+ #define HKS_UPDATEHOTKEY "mhotkeyupdate"
+
+ /* gets function hash by function name, the result is stored in lParam(KEYHASH*)
+ wParam = (const char*)functionName
+ lParam = (KEYHASH*) - here the result is stored
+ */
+ #define HKS_GET_HASH_BYNAME "mhgethashbyname"
+ /* gets functoin name by it's hash the GETNAMEPARAM struct must be filled before calling this
+ it has to be passed as wParam, and there will be result stored.
+ wParam=(GETNAMEPARAM*)Result
+ lParam=(KEYHASH*)keyHash
+ */
+ #define HKS_GET_NAME_BYHASH "mhgetnamebyhash"
+ /* converts keyHash to windows hotkey
+ wParam=(DWORD*)result
+ lParam=(KEYHASH*)hotKey
+ */
+ #define HKS_HASH_TO_HOTKEY "mhhashtohotkey"
+ /*converts windows hotkey to keyHash
+ wParam=(DWORD*)hotkey
+ lParam=(KEYHASH*)result
+ */
+ #define MKS_HOTKEY_TO_HASH "mhhotkeytohash"
+
+#endif \ No newline at end of file