[python-win32] letter and number key codes for win32con
Alex Hall
mehgcap at gmail.com
Sat Jan 16 04:03:52 CET 2010
Subject: Re: [python-win32] letter and number key codes for win32con
> Alex Hall wrote:
>>
>> I am successfully using hotkeys with win32con (thanks so much for that
>> tip!!) but I want to use the numbers 1-0 (on the keyboard, not the
>> numpad) instead of F keys. The code example I have says to use
>> ord('x'), but I am not quite sure what this means or how to give the
>> result of ord() to the hotkey dictionary. Does anyone know the codes
>> to use? I have tried using win32con.49, win32con.VK_49, and all kinds
>> of variants (using 1 instead of 49, using ord() right in the
>> dictionary, using single quotes...) Google is not much help on this;
>> the only forum I found talking about this said that it could not be done.
>
> "ord" is a standard Python function that returns the numeric ASCII value
> of a character. The hotkey code for the 1 key is the ASCII value for
> the character '1', which is the plain, ordinary integer 49. You should
> be able to use either ord('1') or 49.
Okay, the problem was that I was leaving on the "win32con." part, using
"win32con.49" instead of just 49. It worked after I took off that win32con
bit.
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
More information about the python-win32
mailing list