Hi,
Is there a way to always get the control, alt and shift state in a module, not only when the mouse is on the module panel?
thanks
Get control-alt-shift state
- senso
- Site Admin
- Posts: 4427
- Location: France
- Contact:
yes when the procedure MouseMove (void* pModule, TShiftState Shift, int X, int Y) is called Usine fill the ShiftState in the 'Shift' parameter.
But there is an error in the Userdefinitions.h file
must be replaced by
so you can check if 'Shift' contains one or several values above.
This error will be 'officially' corrected in the next SDK release.
But there is an error in the Userdefinitions.h file
Code: Select all
//----------------------------------------------------------------------------
// keys state modifiers
// used in MouseMove, MouseUp and MouseDown functions declaration (see end of file)
typedef enum TShiftState {
ssShift,
ssAlt,
ssCtrl,
ssLeft,
ssRight,
ssMiddle,
ssDouble
};Code: Select all
//----------------------------------------------------------------------------
// keys state modifiers
// used in MouseMove, MouseUp and MouseDown functions declaration (see end of file)
typedef DWORD TShiftState ;
static DWORD const ssShift = 0x1
static DWORD const ssAlt = 0x2
static DWORD const ssCtrl = 0x4
static DWORD const ssLeft = 0x8
static DWORD const ssRight = 0x10
static DWORD const ssMiddle = 0x20
static DWORD const ssDouble = 0x40Code: Select all
if ((Shift & ssCtrl) !=0) {..} //means that the Ctrl key is pressedOlivier Sens
www.brainmodular.com
www.brainmodular.com
- senso
- Site Admin
- Posts: 4427
- Location: France
- Contact:
for that you have to query directly the keyboard state like:
Code: Select all
BYTE state[256];
#define KEY_PRESSED(key) (state[key] & 0x80)
GetKeyboardState(state);
if (KEY_PRESSED(VK_CONTROL) && KEY_PRESSED('C')) {
// CTRL-C pressed
}Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
martignasse
- Site Admin
- Posts: 611
- Location: Lyon, FRANCE
- Contact:
useful infos, have to put this on the wikisenso wrote:for that you have to query directly the keyboard state like:
Code: Select all
BYTE state[256]; #define KEY_PRESSED(key) (state[key] & 0x80) GetKeyboardState(state); if (KEY_PRESSED(VK_CONTROL) && KEY_PRESSED('C')) { // CTRL-C pressed }
thanks senso
Martin FLEURENT - Usine Developer - SDK maintainer
