Results 1 to 3 of 3

Thread: [wx] Get Left or Right Shift/Alt/Ctrl Key Press

  1. #1
    Join Date
    May 2008
    Beans
    1,029

    Question [wx] Get Left or Right Shift/Alt/Ctrl Key Press

    Can wx differentiate between left and right Shift/Alt/Ctrl key presses? I thought there was a way, but maybe I'm wrong. Both left and right key presses produce the same key code. For example left and right Shift both produce 306.

    Code:
    int OnKeyDown(wxKeyEvent &event)
    {
        cout << event.GetKeyCode() << endl;
    }
    Code:
    def OnKeyDown(self, event)
        print event.GetKeyCode()

  2. #2
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: [wx] Get Left or Right Shift/Alt/Ctrl Key Press

    Could you tell us what are you trying to accomplish?
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

  3. #3
    Join Date
    May 2008
    Beans
    1,029

    Re: [wx] Get Left or Right Shift/Alt/Ctrl Key Press

    Mapping keys for game controls.

    ----- EDIT -----
    Quote Originally Posted by RainRat
    You can use wxKeyEvent::GetRawKeyCode or wxKeyEvent::GetRawKeyFlags, but these are platform specific. See wxKeyEvent.
    Last edited by dodle; August 29th, 2011 at 05:29 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •