Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

accessing numpad without pressing numlock

Posted on 2006-06-28
5
Medium Priority
?
293 Views
Last Modified: 2010-04-05
I can use the numbkeys.
with the virtual handle vk_numpad_0-9
but only if NumLook is pressed..
and the 2 4 6 and 8 is possible to press without pressed numlock key..
but i need the other keys too (1,3,7,9) from the numpad.

0
Comment
Question by:Applicationmaker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:AshusCZ
ID: 17001344
What about ensuring that the num-lock is switched on? And if it wasn't, turning it off again.
Should I post a code for this?
0
 

Author Comment

by:Applicationmaker
ID: 17001404
yes AshusCZ, would be nice if you can post code for this :-)
0
 
LVL 10

Assisted Solution

by:atul_parmar
atul_parmar earned 300 total points
ID: 17001520
0
 

Accepted Solution

by:
AshusCZ earned 390 total points
ID: 17001538
var switchedOff: boolean;
   procedure Switch;
   begin
   if switchedOff then
      begin
      keybd_event(VK_NUMLOCK, 0, 0, 0);
      keybd_event(VK_NUMLOCK, 0, 2, 0);
      end;
   end;
begin
switchedOff := (GetKeyState(VK_NUMLOCK) <> 1);
Switch;


/// any code
keybd_event(VK_NUMPAD7, 0, 1, 0);
/// any code


Switch;
end;
0
 
LVL 17

Assisted Solution

by:TheRealLoki
TheRealLoki earned 60 total points
ID: 17005620
you can use the vk_ keys for all the function of the numpad, eg.

vk_NumPad0   = $60;
vk_NumPad1   = $61;
vk_NumPad2   = $62;
vk_NumPad3   = $63;
vk_NumPad4   = $64;
vk_NumPad5   = $65;
vk_NumPad6   = $66;
vk_NumPad7   = $67;
vk_NumPad8   = $68;
vk_NumPad9   = $69;

vk_Insert    = $2D;
vk_Delete    = $2E;
vk_Prior     = $21; //3
vk_Next      = $22; //9
vk_End       = $23; //1
vk_Home      = $24; //7
vk_Left      = $25;
vk_Up        = $26;
vk_Right     = $27;
vk_Down      = $28;
vk_NumLock= $90;
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question