Hi AK,
Thanks a lot.
Yes exactly what I was looking for.
Now I can dstart a python script from vim and react on a few key presses
> import vim
> def getkey():
> return vim.eval("getchar()")
>
> def getascii_char():
> c = getkey()
> if len(c) == 1:
> return chr(int(c))
> return chr(0)
>
>
> def tst():
> txt = ""
> for i in range(10):
> c = getchar()
> txt += "%r " % c
> print txt
On 09/11/2011 01:33 AM, AK wrote:
> On 09/10/2011 02:04 PM, Gelonida N wrote:
>> Hi,
>>
>>
>> . . .
>> Concerning vim scripting I'm an absolute beginner, so forgive my if
>> the answer to my question is obvious
>>
>> Now I wondered whether there is a way, that python could capture a
>> single key press without any prompt.
>>
>>
>
>
> I think you can do something like:
>
> from vim import *
> c = eval("getchar()")
>
> -ak
>
--
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