Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GetNumLock and GetScrollLock functions [FEATURE REQUEST]
Re: GetNumLock and GetScrollLock functions [FEATURE REQUEST] [message #14776 is a reply to message #14770] Fri, 14 March 2008 14:24 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Tom1 wrote on Fri, 14 March 2008 04:33

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


Well, but what is the point, if we cannot do it in X11?

(WinCE admitedly is another issue completely, as it has not keyboard usually).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using U++ without TheIDE
Next Topic: SetCurrentDirectory()
Goto Forum:
  


Current Time: Mon Jun 10 06:10:05 CEST 2024

Total time taken to generate the page: 0.02428 seconds