Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

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.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-2008, 09:57 AM
bodhi2016 bodhi2016 is offline
Newbie
 
Join Date: Jan 2008
Posts: 29
Rep Power: 4
bodhi2016 is on a distinguished road
Default keyboard

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-03-2008, 11:11 AM
MeTh0Dz MeTh0Dz is offline
SLICE OWNZ YOUR SOUL
 
Join Date: May 2008
Posts: 294
Last Blog:
Ternary Operator CPP
Rep Power: 0
MeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura about
Default Re: keyboard

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-10-2008, 12:37 PM
bodhi2016 bodhi2016 is offline
Newbie
 
Join Date: Jan 2008
Posts: 29
Rep Power: 4
bodhi2016 is on a distinguished road
Default Re: keyboard

In short my brother who works in Intel challenged me to make a programme with
which can i switch the caps lock on and off ,without touching the caps lock key directly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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


All times are GMT -5. The time now is 11:43 AM.

Contest Stats

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

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads