Get control-alt-shift state
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
yes, i found the error, but in this way I get the shift state only if I move the mouse (on the window?).
I would like to get the shift state even if I don't move the mouse...
I would like to get the shift state even if I don't move the mouse...
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
Who is online
Users browsing this forum: No registered users and 12 guests
