Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which event after Ctrl + [PLUS]

Status
Not open for further replies.

Toman

Technical User
Mar 30, 2004
190
0
0
CZ
I’d like to hook some action on keys combination Ctrl + [PLUS key on numeric keypad with Key Code = 43], which is quite usual these days.

Problem is that KeyPress procedure does not give any ShiftAltCtrl parameter to check. It is in fact not fired at all.

I know how to read Ctrl state by means of API function GetKeyState. This is of no use also, because it is not clear, when read.

This key combination looks like to be some hotkey on VFP or Windows level, but I’ve never heard what for.

I would by very thankful for any recommendation. Preferable without using a timer.
Bye, Toman
 
Tom, I can confirm what you are seeing, but I can't suggest a solution. At first I thought the behaviour might depend on whether the Num Lock is engaged, but that doesn't seem to be the case.

As far as I know, this key combination is not reserved by VFP. Also, I don't think it's reserved by Windows because at least one application (Firefox) does trap it.

Is it essential that you use Ctrl + ? Would Shift + be a possibility? That seems to work as expected.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
VFP does not see ctrl+ as a valid combiniation

43 is the value for the + by itself.

Shift+ the {+/=) key = 43
+ on the numeric pad = 43
ctrl + the (+) key = nothing
shift + the (+) key = 43
alt + the (+) key = 78

Here is a quick little program you can run to check the return value from any key

Code:
lk=0
DO WHILE lk<>27
	lk=INKEY(0)
	IF lk<>0
	? lk
	ENDIF
enddo



Alan
 
It’s a pity that we can’t use Ctrl combinations like the others.

To Mike: I can’t use Shift, because I’ve used it already. My task was to increase / decrease a date in textbox. With [PLUS] / [MINUS] by a day, with Shift+[PLUS] / Shift+[MINUS] by a month and with Ctrl+[PLUS] / Ctrl+[MINUS] by an year. Last mentioned remains a wish only.

To Alan: alt + the (+) key = 78 … for the first sight it’s not bad idea to use Alt instead of Ctrl, but on my machine alt + the (-) key returns nothing, so again of no use for me. More: The Alt key is traditionally dedicated to selection of menu items

Thank you, gentlemen
Tom
 
how about PG UP and PG Down? they send unique cords with Shift, CTRL and Alt.

Alan
 
Good tip, thank you Alan.
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top