Win32 Mysteries: Undo in Fields Broken, Right Bracket and Non-US Layouts

  • From: Veli-Pekka Tätilä <vtatila@xxxxxxxxxxxxxxxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 22 Nov 2007 13:07:16 +0200

Hi,
A question on the behavior of Windows standard fields, and some keyboard
mysteries:
Try the following in a standard multiline text field such as notepad.

1. Type in the string initial.
2. Select the previous word with ctrl+shift+left 
3. Now type over the string second.
4. Cursor a word left with ctrl+left.
5. Next, type in the string first, the field reads firstsecond.
6. Activate undo with ctrl+z. Now the field reads initialsecond.

What the? Why on Earth does undo work like this, it conflicts with my
mental model of things pretty badly since the field goes into a state
which is none of the previous states. Can any Win32 coder offer an
explanation? Does undo work differently in Vista? Also, why doesn't
ctrl+backspace delete a word in Notepad under XP?

I think of undo as storing previous states of the control in question
and undo and redo sequentially navigating in the undo history. What
triggers saving the previous states depends and can be regarded as the
undo's grain size. FOr instance, appending text in words does not, but
adding text in the middle or deleting some does, in the standard Windows
text field.

Also, I wonder why ctrl+backspace doesn't work in multiline fields like
Notepad to delete a word? It works in single line fields like the run
box.

Another question related to keyboard command processing I have is this:
Screen reader key strokes like left control, left shift, right bracket
don't work on the Finnish keyboard, since the US right bracket key is an
accent key (¨) that requires the accented letter after it. Can these key
strokes be made to work using some API functions or is the right bracket
key something to be always avoided? To enter a right bracket literally
on the FInnish keyboard you press [ alt gr and 8.

Any help appreciated in solving any of these.

-- 
With kind regards Veli-Pekka Tätilä (vtatila@xxxxxxxxxxxxxxxxxxxx)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts:

  • » Win32 Mysteries: Undo in Fields Broken, Right Bracket and Non-US Layouts