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

Author Topic: KeyEventArgs.Alt / Control / Shift  (Read 4701 times)

0 Members and 2 Guests are viewing this topic.

thoniel

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 157157736
    • View Profile
KeyEventArgs.Alt / Control / Shift
« on: July 14, 2009, 04:54:41 pm »
hi
im using sfml 1.5 with c# and trying to wrap parts of sfml so have it easy to modifiy things.

right now, im wrapping Input in my own input class. and by that i recognized that KeyEventArgs.Alt etc. do not seem to work.

i have a method that listens to KeyPressed for example. but when i press Alt and A,first Alt and then A events are fired (in the keycodes, the booleans are never true).

is that right?

cheers

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
KeyEventArgs.Alt / Control / Shift
« Reply #1 on: July 14, 2009, 06:12:11 pm »
You're talking about KeyEventArgs and Input, but they are unrelated. Can you show some code?
Laurent Gomila - SFML developer

thoniel

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 157157736
    • View Profile
KeyEventArgs.Alt / Control / Shift
« Reply #2 on: July 14, 2009, 07:00:35 pm »
yeah sorry, they are unrelated in sfml but in my Input class i put your input functions and in addition the events from Window


Code: [Select]

            window.KeyPressed += new EventHandler<SFML.Window.KeyEventArgs>(OnKeyPressedSFML);

Code: [Select]


        private void OnKeyPressedSFML(object sender, SFML.Window.KeyEventArgs args)
        {
            String ret = "SFML:";

            if (args.Alt)
                ret += " Alt";

            if (args.Control)
                ret += " Ctrl";

            if (args.Shift)
                ret += " Shift";

            ret += " " + args.Code;

            write(ret);
        }

thoniel

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 157157736
    • View Profile
KeyEventArgs.Alt / Control / Shift
« Reply #3 on: July 14, 2009, 10:04:16 pm »
so, is that a bug or am i getting the meaning of the booleans wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
KeyEventArgs.Alt / Control / Shift
« Reply #4 on: July 14, 2009, 11:41:31 pm »
It's a bug, I'll try to fix it as soon as possible.

Until I solve it, a simple workaround is to use the Input class to know if Control/Alt/Shift are pressed.
Laurent Gomila - SFML developer

thoniel

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 157157736
    • View Profile
KeyEventArgs.Alt / Control / Shift
« Reply #5 on: July 14, 2009, 11:57:55 pm »
yeah thanks. the biggest reason to use this library is your support ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
KeyEventArgs.Alt / Control / Shift
« Reply #6 on: July 17, 2009, 10:01:49 am »
It's fixed.
Laurent Gomila - SFML developer