Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sun May 27, 2018 9:01 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jan 16, 2008 1:18 pm 
Offline

Joined: Wed Jan 16, 2008 7:09 am
Posts: 8
I need to ensure that the key repeat rate is set to a specific value. I check the registry key HKCU/ControlPanel/Keybd/RepeatRate and modify it if it does not equal the value I want. The registry editor shows that the modification took place, but the actual key repeat does not change. If I open the keyboard control panel, it shows the value prior to my modification, and when I close it, it changes the registry value back to the value shown on the control panel.



Is there a way to notify the os that the value was changed, so it becomes active during the program?



Otherwise, is there a way to use DeviceIoControl to set the repeat rate for the program?





Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 1:50 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Quote:
Is there a way to notify the os that the value was changed, so it becomes active during the program?




I know that if you reboot the TREQ, the value in the registry will take effect. I don't not know of a way to make the setting effective immediately except using DeviceIoControl.



Quote:
Otherwise, is there a way to use DeviceIoControl to set the repeat rate for the program?




Yes



Code:
// set auto repeat delay and rate (global)

#include <keybd.h>  // from SDK, for struct defn



// all int32 struct members, only first 2 matter

// delay is in ms

// repeat rate is in keys/sec

KBDI_AUTOREPEAT_INFO ai = { delay, repeatRate, 0, 0 };

DeviceIoControl(hDevice, IOCTL_KBD_SET_AUTOREPEAT, &ai, sizeof(&ai), NULL, 0, NULL, NULL);

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
 Post subject: Thanks Ron.
PostPosted: Thu Jan 17, 2008 6:14 am 
Offline

Joined: Wed Jan 16, 2008 7:09 am
Posts: 8
Thanks Ron, that did the trick, I did need to change
Code:
sizeof(&ai)
to
Code:
sizeof(ai)
in the function call though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group