|
|
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: 1212 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
|
|
|
|
Re: GetNumLock and GetScrollLock functions [FEATURE REQUEST] [message #14782 is a reply to message #14776] |
Fri, 14 March 2008 16:23 |
Tom1
Messages: 1212 Registered: March 2007
|
Senior Contributor |
|
|
Quite frankly, I was kind of hoping someone already knew how to make it happen in X11 and would generously donate that knowledge to the Upp code base. If it is simply impossible, I will have to reconsider if I should anymore use key bindings to Scroll Lock at all.
// Tom
|
|
|
|
Goto Forum:
Current Time: Thu Apr 18 10:55:45 CEST 2024
Total time taken to generate the page: 0.01658 seconds
|
|
|