[python-win32] Keystrokes Python

Tim Roberts timr at probo.com
Mon Jun 16 19:36:07 CEST 2008


leegold wrote:
> Wondered if Python could solve this problem:
>
> I have laptop with XP. To adjust screen contrast I hit FN key then F11.
> It does not work well - I end up with too little/much contrast - the key
> combo does not provide the granularity/fine adjustment I want. There's
> no 0-100 bar graph as well. It's probably tied with the ACPI - Advanced
> Configuration and Power Interface too which I know very little about -
> If I reset the BIOS to defaults, monitor settings seem to go back to
> normal.
>
> What I thought of doing was somehow programatically recreate one (1)
> FN-F11 keystoke message and see what effect it has. 
>   

This is, in general, not possible.  The Fn keystrokes are trapped and 
handled by the BIOS.  When one of them does something that a Windows 
driver needs to know about, the BIOS fires some kind of event (like an 
ACPI event).  The Fn keys themselves never get to Windows.  There is no 
"Fn" key in the standard virtual key set, so there is no way for you to 
simulate one.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list