how to capture mouse events / raw events? #3032
Unanswered
gaenseklein
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i am trying to capture mouse events but cant get it to work.
first i tried with the method
preMousePress(view, event)
i copied from the filemanager-plugin, but that does not do anything - it seems its not even called on mouseclicks (left click).onMousePress
neither.but mouse-support seems working fine - i can click, double-click and tripple-click, i can select text...
when i open "raw" i see two events:
now as i see there is a difference between my computer and the pinephone (touchscreen) - which does not bother me.
in fact i need mouse-support only on "mouse-first"-devices such as the pinephone and see mouse-support as not so important in general as micro is a heavy keyboard focused editor and that is why i like it so much.
but on the pinephone you need to have an external keyboard or else it would be much more comfortable to have some little buttons on the top you can use. as such i wanted to write a pinephone-plugin which allows me to use micro with touchscreen. for that i need to:
i think that for both i would be satisfied if i would have a hook to the events i see in raw, so that i can react to them. is there a method i could use to listen to such raw-events? because i could not find it.
i experimented a bit with building a function and then keybinding the function to MouseLeft:
but that does two things:
as userdata is not lua-code i cant inspect it from inside lua - i have to know what userdata contains to acces it (or am i wrong here?) i tried to figure it out in code but without success so far.
maybe someone here can help me out? i am stuck right now and dont know how to proceed further (apart from maybe filing a bug report/issue that preMousePress does not work at all?)
Beta Was this translation helpful? Give feedback.
All reactions