|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Well i am reading the keyboard portion of the book.I want to make a programme with which i can switch the caps lock on and off.
iState = GetKeyState (VK_CAPITAL) ; has the low bit set if the Caps Lock key is toggled on Can somebody explain me the meaning of low bit set.Does it mean that the extreme left hand side is bit 0. Is there any way i can force the VK_capital to change the value so that it has a high bit set then i can switch off the caps lock from the programme. Often i have seen this numbers like 0X00081 or 0x00001 .CAn anybody please tell the meaning of this or any articke in the net about this, Thank You |
| Sponsored Links |
|
|
|
|||
|
Your post is confusing. First you say you want to switch the state of the cap locks key, then you start asking questions about GetKeyState(). Which is a function that gets that status of a key.
To answer your question about the low bit / high bit. The high bit is -> (0x10000000) and the low bit is -> (0x00000001). Basically you are going to want to 'And' (&) your return values with one of those values depending on what you are trying to do. That is how you check the status of a key, however using GetAsyncKeyState() might be a better choice, search on MSDN for more information. Now, to actual change the key state, you need to use some different functions. You will need to use SetKeyboardState(), SendInput(), or keybd_event(). These functions can be used to toggle the status of the cap locks key, hence turning it on or off. Use msdn to learn the syntax of these commands. Hopefully that helps out. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New Apple Keyboard | Lop | Computer Hardware | 5 | 02-13-2008 05:50 AM |
| Assign a keyboard key to a JButton. | gszauer | Java Help | 4 | 01-08-2008 03:09 PM |
| Keyboard Protection for Laptops | kseine | Computer Hardware | 1 | 06-14-2007 09:04 AM |
| I need help with Keyboard | andrew | Computer Hardware | 3 | 05-10-2007 07:42 AM |
| chinese keyboard | Void | Technology Ramble | 3 | 11-07-2006 10:05 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |