06-02-2014, 09:54 PM
I am now trying to create macros where the user can trigger QM executables using registered hotkeys.
The problem I have is that I need to save the users preferred hotkey in a textfile.
I figured out to do some basic transformations/translations:
Macro Macro11
But what I want is a simple dialogbox with 2 inputfields.
As soon the user presses any key or key combination (CTRL, SHIFT, ALT,... + KEY), the dialogbox updates the 2 inputfields.
One inputfield shows the key pressed in human readable format.
The other inputfield shows the key translated in VK key codes (this VK code I am saving in ini files)
I made a start here, but what's an efficient way to implement this?
The problem is that I would use a lot of 'ifk' commands, I think this is not needed.
Function keypress_detect
The problem I have is that I need to save the users preferred hotkey in a textfile.
I figured out to do some basic transformations/translations:
Macro Macro11
str s="T"
__QmKeysToText s &_s
out _s
str a
a="F10"
int vk
QmKeyCodeToVK(a &vk)
out vk
But what I want is a simple dialogbox with 2 inputfields.
As soon the user presses any key or key combination (CTRL, SHIFT, ALT,... + KEY), the dialogbox updates the 2 inputfields.
One inputfield shows the key pressed in human readable format.
The other inputfield shows the key translated in VK key codes (this VK code I am saving in ini files)
I made a start here, but what's an efficient way to implement this?
The problem is that I would use a lot of 'ifk' commands, I think this is not needed.
Function keypress_detect
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 222 76 "Dialog"
;1 Static 0x54000200 0x0 8 24 104 12 "Pressed key (human readable):"
;2 Edit 0x54030080 0x200 8 40 104 12 ""
;3 Static 0x54000200 0x0 128 24 30 12 "VK code:"
;4 Edit 0x54030080 0x200 128 40 78 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040105 "*" "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1