Saturday, July 28, 2007

Python - HTA : Capturer la position de la Souris

Cet exemple montre comment capturer la position de la souris en Python

Article de référence :
http://msdn2.microsoft.com/en-us/library/ms531073.aspx

<HTML>
<HEAD><TITLE>Report mouse moves in Python</TITLE>

<BODY onmousemove="reportMove()">
<H1>Python catch the Mouse</H1>

<div id="pos"></div>

<SCRIPT LANGUAGE="Python">
d = document.all
def reportMove():
x = window.event.x
y = window.event.y
d.pos.innerHTML = "posx = %d, posy =%d"%(x, y)
</SCRIPT>

</BODY>
</HTML>

No comments:

Post a Comment