Mouse click event is not working in love2d lua engine - lua

I am trying to make a hold system in love2d. When the left button of the mouse is pressed and it is in the object hitbox, it activates the holding event, but the functions for working with mouse click is not working
I am using love 0.9.1 and already tried using love.mouse.isDown and love.mousepressed.
I have tried with my own code and with the examples in love2d wiki and my mouse is working well, it's not a hardware problem
It is actually not doing nothing, mouse does not working.

You would have to post your code for anyone to know what's not working about it, but here's another question where someone couldn't get their mouse clicks working that I answered, and that might be helpful for you.

I had the same problem. Using love.mouse.isDown("l") (or love.mouse.isDown('l')) instead of love.mouse.isDown(1) solved it for me. And "r" or 'r' instead of 2.

Related

Unable to Dragend Navigator handles in HighStock

I am using a 'spline' chart type in HighStock. The problem is that when I start using either side handles on the Navigator, I'm not able to stop dragging and the handles get stuck with the mouse cursor. I've tried replicating the issue on JSFiddle but it works fine there. Since it's proprietary data I'm playing with, I cannot really post any code. But I do hope that I have made my question pretty clear. If there's anything else I can add, do let me know.
The problem was that MouseUp DOM event was not firing. I got to know this when I used setExtremes event for xAxis. Then, I looked around and found that I had a $('html').on('mouseup') somewhere in another js file messing it all up.
Removed the mouseup event written on html and voila, it worked :)
Thanks to everyone who gave a thought to this.
Cheers!

How to disable flashing image in a button?

I have a Button which is linked to an ImageList. I change the ImageIndex over a OnClickEvent.
Now i got the problem that when i change the image with the OnClickEvent it changes, but if i move my mouse over it it shows me the old one and is pulsing.
Anyone knows how to disable this pulsing / flashing / swapping?
EDIT: HotImage were Index 0.
Are you sure this not a VLC bug? I would advice you the following.
It would be great if you could post the OnClick() event so we can check if something is wrong with the code (auto-change).
To test if that is a VLC bug, try to use the same code on another version of Delphi, if the problem occurs again, it is up to your project and code.
In case everything works fine, I would advice you to contact Embarcadero and to report the issue/bug to them. You will help to a Delphi community and make it stronger.
Also, if you are familiar with Windows API, try to code a pure native button with CreateWindowEx API and internal coded functions for OnClick() event. This is only case if you can't find any other way out.

How to capture mouse clicks outside of form (like with Code Insight in Delphi)

I like the idea of the Delphi Code Insight window (custom listbox on form without borders basically) where you can click outside of the form and it will close it automatically.
My first thought was to call SetCapture/ReleaseCapture in the FormCreate and FormDestroy respectively. I set the form's caption to X/Y on the FormMouseMove, but it doesn't update the coordinates outside of the form.
If I call SetCapture/ReleaseCapture from within MouseDown and MouseUp, it does update the coordinates as expected, so that proves the concept does work.
I tried other things as well, e.g. post a WM_USER in the OnShow event, and call SetCapture from there, but it still doesn't update the coordinates. I then tried the TApplicationEvents component (OnMessage), but that doesn't work either.
I've read several articles already, but wasn't able to find what I was looking for. Some articles called SetCapture from within the MouseMove, but that doesn't work when the mouse cursor starts outside of the form. Hrm...
The next step would be to use a WindowsHook, but that's where I stopped. I know how to implement one, but it just seems like I'm missing something really obvious here. There must be a simpler way to do this.
Any ideas? :)
Cheers,
Jarno
What you want can be done easier by adding TApplicationEvents to your form and use the event OnDeactivate. That one gets triggered whenever the application loses focus.
Maybe WM_NCHITTEST can help you somehow. As they say, if the mouse is captured, this message is sent to the window that has captured the mouse. So I would capture the mouse for the form and then wait until result of this message is HTNOWHERE, which should mean "out of the window".
But as far as I can remember, this never worked for me fine, so I finally used (as you mentioned) mouse hook.But in my case I've had a lot of components on that popup form and you need to consider messaging for them too.
The implementation I've used (with a little changes) and which works is here.
I had a similar problem (I needed to implement a scrolling windows if the mouse pointer hovered over a special area and I was not able to use SetCapture)
and circumvented it using a timer + GetCursorPos method.
Just do then a ScreenToClient and check if the mouse is within the window.

How to navigate BlackBerry BrowserField2 in OS5

I am using the new BrowserField2 in BlackBerry OS5 to display HTML content in my app. There are 3 options available for navigation through links in that content.
CURSOR navigation uses a block cursor and actually moves through the characters of the page. Not very useful for me.
POINTER navigation uses a mouse like pointer that you move around the screen and hover over elements. This could work but there is a bug however in that the browser field captures navigation and never lets go so this mode is effectively broken if you share a screen with any other managers. Once your focus enters the browser field you cannot move focus back out and into neighboring fields. RIM has acknowledged the bug but has no work around.
NONE which is for custom navigation but they offer no explanation as to how you would do this.
What I ideally want is to simply have trackpad movements move the focus through the links and highlight them. Then a click would activate the link. I assume I would select the NONE option above and implement my own focus navigation but I am not clear how this can be accomplished with the new APIs.
Is anyone familiar with the new browser2 component could give some guidance?
Thanks!
There's a workaroudn to getting back the focus out of the BrowserField using the NAVIGATION_POINTER.
I found it in this thread:
http://supportforums.blackberry.com/t5/Java-Development/BrowserField-2-Navigation-Mode/td-p/632172
"farahh" posted this:
I found out a hack..
with the navigation set to pointer mode, a click outside the browserfield manager invokes Manager.invokeAction(int). I used the getFieldWithFocus to verify which field has focus and then switch the focus to something else.
Cheers.
Nahuel
PD: i havent found out how to get the behaviour you want, i need that as well so if you got it working please let me know, its kinda urgent in my project =(
I actually reverted back to the older browser1 (OS4) component because the navigation problems in browserField2 (OS5) were a deal breaker for me. Luckily the OS4 browser does everything I need in terms of functionality and it has the exact navigation behavior I need and there are no focus problems mixing it with other views.

Mouse movement / mouseover and JavaScript evaluation in watir

I have a JavaScript-heavy Rails app which I am testing in watir. I have two specific testing requirements:
I need to be able to simulate moving the mouse to a specific area of the screen (or at least triggering the onmouseover event for a div)
Evaluating a snippet of JavaScript once the above has happened to see if a flag is set correctly
I haven't been able to figure out how to do this in watir. Any ideas on how to do this?
For the first question:
browser.div(:id, "some-id").fire_event "onmouseover"
I have no idea how to solve the second question. You could ask at watir-general.
You can look at the following page for mouse controls:
http://wiki.openqa.org/display/WTR/Right+Click+an+Element

Resources