LMTEventSender - fdechaumont/micecraft GitHub Wiki
This allows to create an Live Mouse Tracker event from your python code to a running instance of Live Mouse Tracker.
The main advantages are:
- Your events are stored in the Live Mouse Tracker database, in the event table. So this event has a frame number
- This is a local call via UDP: you have less than 1ms delay to get to Live Mouse Tracker, so you have frame-perfect accuracy
- The event will be logged via logging.info and will appear in your log file.
Tech notes:
- The events are sent via the UDP network protocol.
- LMT will not accept a connection that is not from "127.0.0.1".
Scenario
Sending a demo event to Live Mouse Tracker
To create an event, just write this. The event will appear briefly at the bottom of the live view of Live Mouse Tracker Run this test to be sure LMT is able to receive your messages
from micecraft.soft.LMTEvent.LMTEventSender import LMTEventSender
LMTEventSender("Test message on 127.0.0.1:8551 from UDP")
Typical real use would be:
LMTEventSender("The lever has been pressed")
...or some general information about the experiment running:
LMTEventSender("The experiment is switching to phase 3")