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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recognizing CTRL+INS in a Grid KeyPress Event 1

Status
Not open for further replies.

CBellucci

Programmer
Apr 20, 2007
38
US
I want to use CTRL+INS in a grid to insert a row in the grid. I can get CTRL+DELETE, CTRL+HOME, CTRL+END, CTRL+PGUP, CTRL+PGDWN to "kick" (that is, the KeyPress event recognizes them). But the CTRL+INS doesn't kick off the KeyPress event.

What am I doing wrong? Are there other options on the grid itself or elsewhere that may be muting this key combination?

Thanks in advance!
 
Chris,

Since your previous post, I've tried several times to assign a macro to CTRL+INS. The keys are simply ignored. Do you do it interactively or programmatically? Can you give me a step-by-step?

Olaf,

Maybe you're right that it's OS dependent. CTRL+INS is a pretty old reserved combo, so maybe it doesn't apply to the newer versions. But I'm reasonably sure that, under XP at least, the keys never reach the application.

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike

Created the macro set so many years ago unable to recall how it was done.

I suspect the code was entered in the editor and not recorded.

If you select Tools > Macros... > New... and press CTFL+INS, the Mmacro name will be 'ctrl_ins' and you can enter code in the editor and then save as required.







FAQ184-2483​
Chris [pc2]
PDFcommander.co.uk
motrac.co.uk
 
If you select Tools > Macros... > New... and press CTFL+INS, the Mmacro name will be 'ctrl_ins' and you can enter code in the editor and then save as required.

Yes, that's what I've been doing. It definitely doesn't work for me.

Maybe someone else can try it - if only to eliminate the possibility that (i) there is something peculiar about my system; or (ii) I am slowly going round the bend.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Maybe you're trying the wrong key for INS?

In the keys between alphabetical and numpad:

[INS] [HOME] [PgUp]
[DEL] [END] [PgDwn]

I don't really know the labels on an english keyboard (too lazy to google a picture), in german it's

[Einfg] [Pos 1] [Bild rauf]
[Entf] [Ende] [Bild runter]

You can combine with either left or right CTRL (german: STRG) key, and it also works in conjunction with num lock, caps lock or scroll lock, totally independant.

Bye, Olaf.
 
Olaf,

You're saying that Chris is right, and you can assign a macro to Ctrl + Ins? If that's so, that's good enough for me. I'm not trying to make a point. I'm only interested in helping the original questioner to identify the options.

I'll try it on another computer later. If it works, than there's clearly something strange about my system. If it doesn't, then I fall back on option (ii) above.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Yes, you should try on a different computer.

Both ON KY LABEL and recording a Macro works for me.

Bye, Olaf.
 
Well, I tried it on my laptop, and it does not work there either.

Both machines have VFP 9.0, Windows XP, and a standard US keyboard.

It must be related to the version of Windows. Olaf says it works with Vista; Dave with Windows 7. But Chris says he has been doing it for ten years, which suggests XP and earlier.

Anybody else able to try it under XP?

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
As you speak of a notebook, are you sure it has not to do with any [fn] key, often notebook keyboards are shrinked and need such combinations of [fn]+[CTRL]+[INS].

Bye, Olaf.
 
Just to bring things up to date:

- I just tried doing the macro on another laptop. This was an identical make and model to the first one I tried, except that it runs Windows 7 rather than XP. This time it worked.

- I tried every combination of fn key, plus NumLock, etc. Made no difference.

- I am in a minority of one on this (except for the original questioner), so it's not worth spending any more time on it.

I would like to have got to the bottom of this, but it's not that important. So let's give it up (unless anybody has anything new to add).

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
OK, the final consequence for Bellucci then just is, there are a minority of computers, on which this won't work, perhaps XP. Another key combination is the recommended solution. If it works for his users and it won't need to work anywhere on any windows, it could still be used as a solution.

Bye, Olaf.
 
Olaf

Out of curiosity I trawled through my personal archives and found 'default.fky' dated 12th August 1998.

The CTRL+INS code is the same as the that posted earlier in this thread, so the date of the file would indicate that such key combinations worked with Windows 98, Windows ME, Windows 2000, Windows XP and later OSs.

FAQ184-2483​
Chris [pc2]
PDFcommander.co.uk
motrac.co.uk
 
The macro for CTRL+INS also works for me. Win 7, VFP 9

BTW, Windows may have "borrowed" CTRL+C, CTRL+V, CTRL+X from Mac, but those were also in use in Apple Basic on an Apple II+. They might have been in use in other BASICs as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top