Page 1 of 1
MoveDocumentStartEx kicking in even with control key pressed
Posted: Mon Oct 31, 2005 1:41 pm
by martinlooker
I have Home mapped to MoveDocumentStartEx.
I have Ctrl+Home mapped to an insert comment macro.
If I press Home, to move to line start, then Ctrl+Home to insert the comment the cursor moves to the top of the page an inserts the comment there, instead of at the beggining of the original line.
It appears that the MoveDocumentStartEx is being called even when the Control key is pressed.
Posted: Wed Nov 02, 2005 3:08 am
by jussij
If I press Home, to move to line start, then Ctrl+Home to insert the comment the cursor moves to the top of the page an inserts the comment there, instead of at the beggining of the original line.
I tried to replicate this by making similar changes to the simple keyboard mapping, but for me the keys worked as as expected
It appears that the MoveDocumentStartEx is being called even when the Control key is pressed.
The
MoveDocumentStartEx by design, will move the cursor to the top of the page if two consecutive Home keys are pressed. So the fact that the cursor moved to the top of the page suggests that two home key events where in fact generated. Are you sure the Windows auto repeat did not generate these extra Home key events
For example if you hold down the home key you will notice the cursor in fact make three movements and ends up at the start of the document. This is
MoveDocumentStartEx working as designed, with the auto repeat generating at lease three Home key press events.
If you do not want these extra cursor movements you need to re-map the Home key to
MoveLineHome and then the cursor will only move to the start of the line.
Cheers Jussi
Posted: Wed Nov 02, 2005 11:33 am
by martinlooker
I've figured it out...
It is not auto-repeat, but my macro includes a call to MoveDocumentStartEx. The intention was to move to the start of the line prior to inserting the comment. As I was also pressing home to move to the line start myself, that resulted in two calls to MoveDocumentStartEx. I'll change the macro to use MoveLineHome to avoid this.
Apologies for wasting your time.