Re: Text cursor movement on Windows



Replying to myself.

I found a "semi" working solution here:
http://ubuntuforums.org/showpost.php?p=9202312&postcount=6

It changes the key binding for forward word using the gtkrc file so
that it generates two "move-cursor" events:
  bind "<Control>Right" { "move-cursor" (words, 2, 0) "move-cursor"
(words, -1, 0) }

However that does not work for the last word in the buffer as it in
that case just moves one forward and one back.

After some experimentation I came up with this instead that seem to
work better for my application:
  bind "<Control>Right" { "move-cursor" (words, 1, 0) "move-cursor"
(logical-positions, 1, 0) }

Obviously this does not jump to the start of the next word if there
are more spaces (or other chracters)  than one but that is not so
common in natural language that my application is used for.

The real solution would probably be to create a new move unit (or user
parameter to the word unit) that move to start of next word.

However even if this quick solution is buggy my users seem to prefer
it over the default GTK behavior.

I've attached the gtkrc in case it would be of interest for anyone.

/Fredrik

On Mon, Jul 12, 2010 at 12:11 PM, Fredrik Corneliusson
<fredrik corneliusson gmail com> wrote:
> Hi,
> The GTK cursor movement convention used to move the cursor one word
> forward (CTRL+Right) differs from what is normal in MS Windows
> (Wimp-theme does not solve this).
>
> The normal behavior in MS Windows is to move to the start of the next
> word (include the space) and on GTK it only moves to the end of the
> word.
> For text editing intensive applications this is an annoyance for
> experienced users.
>
> Does anyone have hints on how to go about make this configurable in a
> client application or if this needs changes at the GTK core?
>
> Regards,
> Fredrik
>

Attachment: gtkrc
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]