From: Steve Achelis on
I’m using the MFC feature pack and the left and right keys don’t work
in my property pane (a CDockablePane) if the app has any accelerator
keys.

The CDockablePane contains CMFCPropertyGridProperty edit controls.
When I position the cursor on the text in the edit control, the left
and right keys do nothing (they should move the cursor left/right).
The home, end, delete, etc keys work.

If I delete the IDR_MAINFRAME ACCELERATORS section from the resource
file, the left/right keys do work correctly in the property pane. If I
add a barebones accelerators section, like the following, the left/
right keys do not work.

IDR_MAINFRAME ACCELERATORS
BEGIN
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
END

I’m stumped!

Help? Ideas? Thanks!
From: Joseph M. Newcomer on
In the case of a grid control, I believe it is more likely that a PreTranslateMessage
handler is eating them. Unfortunately, this is designed to be consistent with Excel, that
got it horribly wrong; in Excel, left and right arrow mean "move to left cell" or "move to
right cell" and not, as any intelligent person would expect while editing input, to move
left or right in the text being typed in.

It would depend on whether the PreTranslateMessage did something based on whether or not
there were accelerator keys defined. People who do grid controls seem to have an
overwhelming urge to do things wrong (e.g., invent a lousy substitute for the Clipboard)
to remain backward compatible with VisiCalc.

You might try reading the code to see what it is doing; presumably we have the complete
Feature Pack source.
joe

On Fri, 13 Nov 2009 09:05:35 -0800 (PST), Steve Achelis <info(a)RescueRigger.com> wrote:

>I�m using the MFC feature pack and the left and right keys don�t work
>in my property pane (a CDockablePane) if the app has any accelerator
>keys.
>
>The CDockablePane contains CMFCPropertyGridProperty edit controls.
>When I position the cursor on the text in the edit control, the left
>and right keys do nothing (they should move the cursor left/right).
>The home, end, delete, etc keys work.
>
>If I delete the IDR_MAINFRAME ACCELERATORS section from the resource
>file, the left/right keys do work correctly in the property pane. If I
>add a barebones accelerators section, like the following, the left/
>right keys do not work.
>
>IDR_MAINFRAME ACCELERATORS
>BEGIN
> VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
>END
>
>I�m stumped!
>
>Help? Ideas? Thanks!
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm