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

Author Topic: [SFML2] [Mac] Support for Command key?  (Read 2315 times)

0 Members and 1 Guest are viewing this topic.

trojanfoe

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
[SFML2] [Mac] Support for Command key?
« on: April 12, 2011, 03:38:59 pm »
Can anyone tell me if the Mac Command key will be supported in the Event::KeyEvent structure in the future and if so, when?

I am no expert but I believe the lack of support for common key sequences (like Command-Q) can be one of the many reasons Apple use to reject applications from the Mac App Store, which would cause me difficulties.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SFML2] [Mac] Support for Command key?
« Reply #1 on: April 12, 2011, 04:13:59 pm »
It is supported. Can you tell us why you think it is not?
Laurent Gomila - SFML developer

trojanfoe

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
[SFML2] [Mac] Support for Command key?
« Reply #2 on: April 12, 2011, 04:23:08 pm »
Quote from: "Laurent"
It is supported. Can you tell us why you think it is not?


Because looking at KeyEvent in Window/Event.hpp shows no boolean for the Command key:

Code: [Select]

struct KeyEvent
{
    Key::Code Code;    ///< Code of the key that has been pressed
    bool      Alt;     ///< Is the Alt key pressed?
    bool      Control; ///< Is the Control key pressed?
    bool      Shift;   ///< Is the Shift key pressed?
};

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SFML2] [Mac] Support for Command key?
« Reply #3 on: April 12, 2011, 04:29:21 pm »
Ah, there. Indeed I must add the corresopnding member:
https://github.com/SFML/SFML/issues/8

But it is detected, so you can use input.IsKeyDown(sf::Key::R/LSystem) as a workaround.
Laurent Gomila - SFML developer

trojanfoe

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
[SFML2] [Mac] Support for Command key?
« Reply #4 on: April 12, 2011, 04:33:57 pm »
Quote from: "Laurent"
Ah, there. Indeed I must add the corresopnding member:
https://github.com/SFML/SFML/issues/8

But it is detected, so you can use input.IsKeyDown(sf::Key::R/LSystem) as a workaround.


OK great stuff, thanks for the reply.