accessing numpad without pressing numlock

Posted on 2006-06-28
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.

Question by:Applicationmaker

Expert Comment

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?

Author Comment

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

Assisted Solution

atul_parmar earned 100 total points
ID: 17001520

Accepted Solution

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

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

LVL 17

Assisted Solution

TheRealLoki earned 20 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;

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi : could not find program, '...exe' 2 165
Printing problem 2 91
Making delphi communicate with a c# service 16 103
Twebbrowser in Fire monkey android scrolling to bottom 1 29
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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