I've been attempting to re-implement SmartPad support into CEmu for a presentation I'll be doing soon. However, I do not understand the format that keypad.cpp uses to map computer keys to calculator keys.
I'm particularly having trouble with the defined macros. I don't know what their names stand for and figuring out the correct arguments for each has been tricky. I'm not sure any of the existing macros will work since I need to check if multiple modifiers are pressed. For example: ctrl+win+alt+shift+F11
After a lot of trial and error I've commented my findings
Code:
My questions are:
What do the macro names mean, and how do I apply multiple modifiers?
I'm particularly having trouble with the defined macros. I don't know what their names stand for and figuring out the correct arguments for each has been tricky. I'm not sure any of the existing macros will work since I need to check if multiple modifiers are pressed. For example: ctrl+win+alt+shift+F11
After a lot of trial and error I've commented my findings
Code:
//This applies the final code to key conversion. It's called by all the following macros
#define HK(code, nativeCode, nativeMask, modifier, mask) { Qt::Key_##code, nativeCode, nativeMask, Qt::modifier##Modifier, Qt::mask##Modifier, QStringLiteral(#code) }
//The main key seems to work if there are 0 or more modifiers.
#define NRM(code) HK(code, 0, 0, No, No)
//only used twice and only in Wabbit controls, don't understand what 'nativeCode' or 'nativeMask' are.
#define NAT(code, nativeCode, nativeMask) HK(code, nativeCode, nativeMask, No, No)
/* code: The main key that was pressed
* modifier: When added but mask is set to 'No', it seems to prevent the main key from working at all.
* When added and mask is set to the same modifier, the main key now only works if the modifier is held.
* mask: the MOD function will ignore the main key if the 'mask' modifier is pressed.
*/
#define MOD(code, modifier, mask) HK(code, 0, 0, modifier, mask)
My questions are:
What do the macro names mean, and how do I apply multiple modifiers?