Skip to content

Commit

Permalink
add WatchWinMsg sample
Browse files Browse the repository at this point in the history
  • Loading branch information
CEXT-Dan committed Sep 15, 2024
1 parent 60633e9 commit 74b89e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 0 additions & 1 deletion PyRxCore/PyApApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ bool PyApApplication::registerWatchWinMsg(const boost::python::object& winmsg_pf

bool PyApApplication::removeWatchWinMsg(const boost::python::object& winmsg_pfn)
{

if (winmsgFuncs.contains(winmsg_pfn.ptr()))
{
winmsgFuncs.erase(winmsg_pfn.ptr());
Expand Down
28 changes: 28 additions & 0 deletions PySamples/PyAp/testWatchWinMsg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import traceback
from pyrx_imp import Rx, Ge, Gs, Gi, Db, Ap, Ed

#WatchWinMsg
print("command = startWatch")
print("command = endWatch")

WM_MOUSEMOVE = 512

#messageId, hwnd, lParam, wParam, pt.x, pt.y,time));
def winMessage(msg):
if msg[0] == WM_MOUSEMOVE:
print(msg[4],msg[5])


def PyRxCmd_startWatch():
try:
Ap.Application.registerWatchWinMsg(winMessage)
except Exception as err:
print(err)

def PyRxCmd_endWatch():
try:
Ap.Application.removeWatchWinMsg(winMessage)
except Exception as err:
print(err)


0 comments on commit 74b89e4

Please sign in to comment.