|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GetNumLock and GetScrollLock functions [FEATURE REQUEST]
GetNumLock and GetScrollLock functions [FEATURE REQUEST] [message #14770] |
Fri, 14 March 2008 09:33 |
Tom1
Messages: 1217 Registered: March 2007
|
Senior Contributor |
|
|
Hi,
Please add GetNumLock and GetScrollLock functions to CtrlCore package. The required code for Windows is here:
CtrlCore.h:
...
#ifdef PLATFORM_WIN32
#ifdef PLATFORM_WINCE
bool GetShift();
bool GetCtrl();
bool GetAlt();
bool GetCapsLock();
bool GetNumLock(); // Added by Tom
bool GetScrollLock(); // Added by Tom
bool GetMouseLeft();
bool GetMouseRight();
bool GetMouseMiddle();
#else
inline bool GetShift() { return !!(GetKeyState(VK_SHIFT) & 0x8000); }
inline bool GetCtrl() { return !!(GetKeyState(VK_CONTROL) & 0x8000); }
inline bool GetAlt() { return !!(GetKeyState(VK_MENU) & 0x8000); }
inline bool GetCapsLock() { return !!(GetKeyState(VK_CAPITAL) & 1); }
inline bool GetNumLock() { return !!(GetKeyState(VK_NUMLOCK) & 1); } // Added by Tom
inline bool GetScrollLock() { return !!(GetKeyState(VK_SCROLL) & 1); } // Added by Tom
inline bool GetMouseLeft() { return !!(GetKeyState(VK_LBUTTON) & 0x8000); }
inline bool GetMouseRight() { return !!(GetKeyState(VK_RBUTTON) & 0x8000); }
inline bool GetMouseMiddle() { return !!(GetKeyState(VK_MBUTTON) & 0x8000); }
#endif
#endif
#ifdef PLATFORM_X11
bool GetShift();
bool GetCtrl();
bool GetAlt();
bool GetCapsLock();
inline bool GetNumLock(){ return false; } // Added by Tom
inline bool GetScrollLock(){ return false; } // Added by Tom
bool GetMouseLeft();
bool GetMouseRight();
bool GetMouseMiddle();
...
Win32Proc.cpp:
...
#ifdef PLATFORM_WINCE
bool GetShift() { return false; }
bool GetCtrl() { return false; }
bool GetAlt() { return false; }
bool GetCapsLock() { return false; }
bool GetNumLock() { return false; } // Added by Tom
bool GetScrollLock() { return false; } // Added by Tom
bool wince_mouseleft;
bool wince_mouseright;
...
I do not seem to be able to figure out how to do it in X, but I guess somebody else can...
// Tom
|
|
|
Goto Forum:
Current Time: Mon Jun 10 14:28:04 CEST 2024
Total time taken to generate the page: 0.01811 seconds
|
|
|