Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
keyboard keys get pressed when i hover my mouse on sfml window.
Print
Pages: [
1
]
Author
Topic: keyboard keys get pressed when i hover my mouse on sfml window. (Read 1066 times)
0 Members and 1 Guest are viewing this topic.
Nauman Ali
Newbie
Posts: 1
keyboard keys get pressed when i hover my mouse on sfml window.
«
on:
April 30, 2017, 06:57:37 am »
please help me with this. its my first time with sfml.
The problem is that whenever i move mouse on window keys are pressed and on left side of window escape key or return key is pressed.
Logged
Hapax
Hero Member
Posts: 3379
My number of posts is shown in hexadecimal.
Re: keyboard keys get pressed when i hover my mouse on sfml window.
«
Reply #1 on:
April 30, 2017, 12:01:16 pm »
An sf::Event is a
union
and due to this, the key code should never be queried unless the event is confirmed to be a key event type.
For example:
if
(
event.
type
==
sf
::
Event
::
Keypressed
)
{
if
(
event.
key
.
code
==
sf
::
Keyboard
::
Escape
)
escapeWasPressed
(
)
;
}
Logged
Selba Ward
-SFML drawables
Cheese Map
-Drawable Layered Tile Map
Kairos
-Timing Library
Grambol
*
Hapaxia Links
*
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
keyboard keys get pressed when i hover my mouse on sfml window.
anything