I am pretty new to Löve. I use a couple of different laptops and I DON’T connect a mouse. I exclusively use the touchpad. Do I need to do something special when programming so that the program recognizes the touchpad as the “mouse”?
I’ve copied and run the code from https://gist.github.com/BlackBulletIV/1196228. This code is basically a tutorial on how to drag using a mouse. When I run it, as expected it creates a window with a 100x100 white box in it. The white box is supposed to be draggable, but nothing happens when I try to drag it.
The code seems to be correct, so I suspect the problem is related to my not using a real mouse, but I don’t know. What should I do?
Thanks in advance.
how to use touchpad as mouse?
Re: how to use touchpad as mouse?
That code is out of date. The buttons are numeric constants now, not strings; instead of "l" (letter in a string) you'll have to use 1 (number) in mousepressed, mousereleased and lm.isDown.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: how to use touchpad as mouse?
Thanks.
I changed the "l" to a "1" in the mousepressed and mousereleased lines but I didn't see lm.isDown anywhere. I still get the same result when I run it. The window opens with the box in it but I can't drag the box.
I use ZeroBrane Studio to do the programming and when I run it I get an error message in the bottom panel of ZeroBrane:
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
I changed the "l" to a "1" in the mousepressed and mousereleased lines but I didn't see lm.isDown anywhere. I still get the same result when I run it. The window opens with the box in it but I can't drag the box.
I use ZeroBrane Studio to do the programming and when I run it I get an error message in the bottom panel of ZeroBrane:
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Re: how to use touchpad as mouse?
I usually use Linux. I just tried this same program in Windows with the same result except I didn't get the error message.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: how to use touchpad as mouse?
You need to change it to a 1, not in quotes.randy0428 wrote: I changed the "l" to a "1" in the mousepressed and mousereleased lines
That will happen if you have the JACK client libraries installed, you are not running JACK and OpenAL Soft is configured to check for JACK before PulseAudio/ALSA/whatever you're using (which is the default setting). But it's perfectly harmless.randy0428 wrote: connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
And please don't double-post, just edit your previous post instead.
Re: how to use touchpad as mouse?
The number 1 is not in quotes. It still doesn't drag.
I'll avoid the double posting in the future. I didn't think I could edit the posts. Now I know.
I'll avoid the double posting in the future. I didn't think I could edit the posts. Now I know.
Re: how to use touchpad as mouse?
Could you upload a .love file then?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: how to use touchpad as mouse?
I feel like a complete idiot. You told me that there were no quotation marks around the 1 for the mouse button. When I changed the l to 1, I just changed that without thinking that the l is a string and needs to be enclosed in quotes. I didn't think to remove the quotes, so they were still there. I've now corrected that and I can drag the box.
I apologize for wasting your time by not checking this sooner.
Thanks for your help.
I apologize for wasting your time by not checking this sooner.
Thanks for your help.
Re: how to use touchpad as mouse?
Don't worry! I think all of us did at some point go through such frustrating situations
https://github.com/Sulunia
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: how to use touchpad as mouse?
To be fair, Löve has changed this a few times. It used to be "l" and "r". And the wheel up and down used to be part of the mouse pressed and released callbacks.
Who is online
Users browsing this forum: Bing [Bot], slime and 12 guests