I'm not sure where I got this from, but I think its from your site.. <br><br>import msvcrt<br><br>def doKeyEvent(key):<br>&nbsp;&nbsp;&nbsp; if key == '\x00' or key == '\xe0': # non ASCII<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; key = msvcrt.getch() # fetch second character
<br>&nbsp;&nbsp;&nbsp; print ord(key)<br><br>def doQuitEvent(key):<br>&nbsp;&nbsp;&nbsp; raise SystemExit<br><br><br># First, clear the screen of clutter then warn the user <br># of what to do to quit<br>lines = 25 # set to number of lines in console<br>
for line in range(lines): print<br><br>print &quot;Hit space to end...&quot;<br>print<br><br># Now mainloop runs &quot;forever&quot;<br>while True:<br>&nbsp;&nbsp; ky = msvcrt.getch()<br>&nbsp;&nbsp; length = len(ky)<br>&nbsp;&nbsp; if length != 0:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # send events to event handling functions<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ky == &quot; &quot;: # check for quit event<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doQuitEvent(ky)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else: <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doKeyEvent(ky)<br><br><br><div><span class="gmail_quote">On 11/2/06, 
<b class="gmail_sendername">Alan Gauld</b> &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&quot;Chris Hengge&quot; &lt;<a href="mailto:pyro9219@gmail.com">pyro9219@gmail.com</a>&gt; wrote<br>&gt; Do you by chance know of a way to capture special keys like &quot;Print<br>&gt; Screen&quot;?<br><br>Try the key capture code in my Event Driven topic.
<br><br>So far as I know it works for all keys including the special ones.<br>It also points out that those keys have a two part code...<br><br>--<br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">
http://www.freenetpages.co.uk/hp/alan.gauld</a><br><br><br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">
http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>