Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
Mouse Button Pressed and then Moved
Print
Pages: [
1
]
Author
Topic: Mouse Button Pressed and then Moved (Read 1130 times)
0 Members and 1 Guest are viewing this topic.
khasanovasad
Newbie
Posts: 1
Mouse Button Pressed and then Moved
«
on:
June 16, 2020, 01:53:14 pm »
Hi there.
I want my program to detect the following event: Mouse Button Pressed + Mouse Moved
I tried this way:
case
sf
::
Event
::
MouseMoved
:
if
(
sf
::
Mouse
::
isButtonPressed
)
{
DoStuff
(
)
;
}
break
;
But this does not seem to be the thing I want. Any help would be appreciated. Thanks in advance.
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11034
Re: Mouse Button Pressed and then Moved
«
Reply #1 on:
June 16, 2020, 02:07:28 pm »
You could track the mouse button state in a separate variable, so when you get a mouse moved event, you can check whether the mouse button is pressed or not.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
Mouse Button Pressed and then Moved
anything