Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: KeyRepeat only for TextEntered event  (Read 3277 times)

0 Members and 2 Guests are viewing this topic.

amin.v

  • Newbie
  • *
  • Posts: 4
    • View Profile
KeyRepeat only for TextEntered event
« on: November 09, 2017, 04:10:32 pm »
hi

is it possible to get key repeat only for TextEntered event because i use this event for GUI text input which is usefull but i also use KeyPressed/KeyReleased for game logic which then key repeat is not usefull there.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: KeyRepeat only for TextEntered event
« Reply #1 on: November 09, 2017, 04:16:42 pm »
You can enable/disable it when you switch between GUI and in-game controls, alternatively you could ignore the additional KeyPresses if you haven't received a KeyRelease.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

achpile

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • Achpile's homepage
    • Email
Re: KeyRepeat only for TextEntered event
« Reply #2 on: November 09, 2017, 05:04:11 pm »
you can use sf::Keyboard::isKeyPressed for game logic :) it's better way imo

amin.v

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: KeyRepeat only for TextEntered event
« Reply #3 on: November 09, 2017, 09:11:35 pm »
You can enable/disable it when you switch between GUI and in-game controls, alternatively you could ignore the additional KeyPresses if you haven't received a KeyRelease.

Quote
you can use sf::Keyboard::isKeyPressed for game logic :) it's better way imo

Thank you both for reply  ;)