Mouse movement detection and processing from client UI

51 views
Skip to first unread message

Tristania W

unread,
Oct 26, 2021, 10:03:16 PM10/26/21
to Django users
So there are Python packages out there that can handle mouse movement detection locally. But for a Django app, how do we go about do this? Clearly we cannot have any processing power on the client machine. Below are some examples to be more specific:
1 - An e-commerce page where buyer clicks, drags (i.e. holds the mouse) and drops a picture of an item from shelf to cart.
2 - A web game where player clicks, drags and drops things from one location on the screen to another.
3 - Web page responds to location of mouse on screen (i.e. coordinates) such as GPS-related apps with real map.

Thanks,

Derek

unread,
Oct 28, 2021, 1:54:39 AM10/28/21
to Django users
I am not sure about the others, but certainly for map clicks you'll need JavaScript  e.g.
Of course, the page itself, with JS code links, snippets and supporting data can be generated via Django in the normal way.

HTH

Bazil M H

unread,
Dec 7, 2021, 8:58:20 AM12/7/21
to Django users
Mouse clicks are client side actions. You need javascript to get that data. One solution maybe capturing the mouse clicks at the client side via javascript and sending the data as JSON to your backend by AJAX. Just a suggestion. 
Reply all
Reply to author
Forward
0 new messages