GVIM: alt/meta keys: inconsistent results for getchar(0)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GVIM: alt/meta keys: inconsistent results for getchar(0)

lith
Hi!

When I run this code in Windows GVIM and press, e.g., <m-down> in a row:

    sleep 1|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor

I get a mix of '<80><fc>^H<80>ku' and '<80><fc>^H'.

When I increase the timeout to 150m, I get only '<80><fc>^H<80>ku', which seems correct.

Is this expected? Is it a bug? Is there another way to make sure I get the right key code other that using sleep?

Regards,
Tom

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: GVIM: alt/meta keys: inconsistent results for getchar(0)

lith
> When I run this code in Windows GVIM and press, e.g., <m-down> in a row:
>
>     sleep 1|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor
>
> I get a mix of '<80><fc>^H<80>ku' and '<80><fc>^H'.

Additional question: When I press <m-down> only once, I get one '<80><fc>^H<80>ku' and 9 '<80><fc>^H' although no key is pressed at that time.

This can also be done with:

    echo getchar()|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor

Is that expected? In this situation, I'd naivly expect the first getchar() to return '<80><fc>^H<80>ku', and the subsequent getchar(0) to return 0.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: GVIM: alt/meta keys: inconsistent results for getchar(0)

Bram Moolenaar

> > When I run this code in Windows GVIM and press, e.g., <m-down> in a row:
> >
> >     sleep 1|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor
> >
> > I get a mix of '<80><fc>^H<80>ku' and '<80><fc>^H'.
>
> Additional question: When I press <m-down> only once, I get one '<80><fc>^H<80>ku' and 9 '<80><fc>^H' although no key is pressed at that time.
>
> This can also be done with:
>
>     echo getchar()|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor
>
> Is that expected? In this situation, I'd naivly expect the first getchar() to return '<80><fc>^H<80>ku', and the subsequent getchar(0) to return 0.

I don't see how you can get a modifier sequence without anything
following.  Would require some debugging.

--
All good vision statements are created by groups of people with bloated
bladders who would rather be doing anything else.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: GVIM: alt/meta keys: inconsistent results for getchar(0)

lith
> I don't see how you can get a modifier sequence without anything
> following.  Would require some debugging.

I submitted a bug report as a reminder.

Regards

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.