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

Author Topic: Converting keycodes  (Read 1744 times)

0 Members and 1 Guest are viewing this topic.

cfrankb

  • Newbie
  • *
  • Posts: 29
    • View Profile
Converting keycodes
« on: July 04, 2010, 11:25:20 am »
Is there an easy way to convert qt keycodes to SFML and vice versa?

Regards,
Frank B.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Converting keycodes
« Reply #1 on: July 04, 2010, 12:51:05 pm »
Yes, with a huge switch.

But... why?
Laurent Gomila - SFML developer

cfrankb

  • Newbie
  • *
  • Posts: 29
    • View Profile
Converting keycodes
« Reply #2 on: July 05, 2010, 05:41:15 pm »
That's what I was afraid of. :(

It just so happens that I have a qt/sfml application that works rather well except for those moments when the sfml windows decides to lose input focus and no longer receives messages.

My workarround was to grab the messages from qt and feed them to key mapper code that normally processes the sfml msg queue. The idea does what it is intended with the few keys that are used to manipulate the sfml view. However, I plan to let the user redefine the keys so that leaves me open to the whole problem again.

That's where having a mean to do the convertion would be very useful. Not just to work arround the issue but also to let the user define shortcuts sequences (he's press keys in qt dialog, I'd convert those keys to sfml equivants for use later in the sfml windows).

Regards,
Frank B.

 

anything