SFML community forums

Help => Window => Topic started by: kipbits on September 22, 2015, 10:28:26 pm

Title: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: kipbits on September 22, 2015, 10:28:26 pm
Hello all, this will be my first post here. I'm trying to get my keyboard input working properly, and I ran into a problem with the dash/underscore key. I've downloaded 2.3.2 and I'm pretty sure I have it installed in the right location, but I'm still getting a problem with the dash/underscore key. I wrote a little test, the "A" and "=" are working, but not dash:

#include <iostream>
#include <SFML/Audio.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>


int main(){
    while (true){
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::A)){//1
            std::cout << "aA\n";
        }
       
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Dash)){// error???
            std::cout << "-dash-\n";
        }
       
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Subtract)){// error???
            std::cout << "-minus-\n";
        }
       
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Equal)){
            std::cout << "=\n";
        }
    }
    return 0;
}

I'm using a macbook pro with yosemite, and no extended keyboard, I hope that makes it clear.
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: eXpl0it3r on September 23, 2015, 08:12:43 am
And what's the problem?
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: kipbits on September 23, 2015, 01:24:49 pm
hyphen(dash) still seams not to work, I've downloaded version 2.3.2, and placed frameworks and dependencies in /Library/Frameworks. I'm still having the problem with dash. any ideas? I've test the whole alphabet and numbers, and this is the only key that doesn't work. are any other mac users having this problem?
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: eXpl0it3r on September 23, 2015, 01:35:57 pm
So your problem is that the key press doesn't get detected? (You never made that fully clear.)
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: kipbits on September 23, 2015, 01:37:34 pm
sorry for the confusion
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: Hiura on September 23, 2015, 01:54:08 pm
Probably because of https://github.com/SFML/SFML/blob/master/src/SFML/Window/OSX/HIDInputManager.mm#L858

What's you kb layout?
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: kipbits on September 23, 2015, 01:55:58 pm
standard english i think. I'm in the US
Title: Re: [Mac]sf::Keyboard::isKeyPressed(sf::Keyboard::Dash) not responding
Post by: kipbits on September 27, 2015, 02:49:07 pm
there seams to already be a thread on github for stuff like this: https://github.com/SFML/SFML/issues/7