Capturing mouse drag

Hello,

I have a gameobject for cursor and I move it when cursor moves. I cannot set my gameobjects position to cursors position because I sometimes have to lock the cursor. So I use

self.cursor_pos.x = self.cursor_pos.x + action.dx
self.cursor_pos.y = self.cursor_pos.y + action.dy

When cursor is on the left edge of the screen, since it can’t move left anymore, action.dx becomes 0. How can I capture the mouse drag in this situtation?

Good question! This information is currently not something the engine provides. I’m thinking that it’s probably possible to get mouse movement in such as case through a native extension.

1 Like

Can you check DefOS? It may help you https://www.defold.com/community/projects/79565/

1 Like

Yes I am using it. I tried to lock the system cursor when cursor object locked. But when I close the game before I unlock the system cursor, cursor stays locked. Can I fix this?

Can you open an issue here, pls?

2 Likes