SFML community forums

Help => Window => Topic started by: netrick on August 17, 2012, 10:48:08 pm

Title: sf::Keyboard::Enter ?
Post by: netrick on August 17, 2012, 10:48:08 pm
Hi.
I'm writing input for my game right now, everything worked perfectly till I wanted to bind one action to enter key... Why  sf::Keyboard::Enter doesn't exist? Documentation says nothing about it, compilator doesn't see it either. Why? I think it's rather important feature to be able to receive "enter" key status. Or maybe there it is implemented but it's not in documentation?

Thanks
Title: Re: sf::Keyboard::Enter ?
Post by: eXpl0it3r on August 17, 2012, 10:52:20 pm
It's just called diffrently, I myself would've prefered the name 'Enter' aswell but 'Return (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Keyboard.php#acb4cacd7cc5802dec45724cf3314a142ac291de81bdee518d636bc359f2ca77de)' is also quite common. ;)

sf::Keyboard::Return
Title: Re: sf::Keyboard::Enter ?
Post by: netrick on August 17, 2012, 10:59:08 pm
Lol, I would never think that return is the enter key. I think it isn't good KISS-type intuitive naming with that key, but good to hear it at least exist. Well, the lib is so good that it doesn't matter.
Title: Re: sf::Keyboard::Enter ?
Post by: eXpl0it3r on August 17, 2012, 11:11:59 pm
I think it isn't good KISS-type intuitive naming with that key.
This has nothing to do with KISS or anything, it's just your intuition and your custom, from the history 'Return' is the right name since it returned the typewriter carrier back to the beginning of the line. The 'Enter' key was introduced later on and some keyboard layouts treated them as diffrent keys for diffrent spacing, but it was always the 'Return' key which occupied the place where you find todays return/enter key (see this wikipedia article (https://en.wikipedia.org/wiki/Enter_key#Differences_between_Enter_and_Return)). ;)
Title: Re: sf::Keyboard::Enter ?
Post by: netrick on August 17, 2012, 11:20:46 pm
Isn't KISS related to intuition in some way ;)? Well of course it is correct name, but I mean 90% of people (especially non-native english speakers) just never ever use "return name", most of them doesn't even know what is return key. Historically it was return, but these days it is basically known as enter I'd say. I am yet to see keyboard with "return" name on that key. Or a game/application that says "press return to open chat". Anyway, it doesn't matter. Return is okay name, enter just in my opinipn would be a bit more intuitive.
Title: Re: sf::Keyboard::Enter ?
Post by: eXpl0it3r on August 18, 2012, 12:59:01 am
Isn't KISS related to intuition in some way ;)?
Yes but not to your personal intuition. ;)

Well of course it is correct name, but I mean 90% of people (especially non-native english speakers) just never ever use "return name", most of them doesn't even know what is return key. Historically it was return, but these days it is basically known as enter I'd say. I am yet to see keyboard with "return" name on that key. Or a game/application that says "press return to open chat". Anyway, it doesn't matter. Return is okay name, enter just in my opinipn would be a bit more intuitive.
This is again just your opinion and your made up numbers (90%) (unless your God and know how everyone is thinking and how their knowledge level of 'return' is). ;D
Fact is that many keyboard layouts don't write down Enter or Return but just leave the edged back arrow on the key. Another fact is that mostly all Apple keyboards have the return naming (I think they still handle Enter and Return diffrently).

It just boils down to personal preferences and from my point of view I haven't seen Enter being way more used than Return and thus I feel like they're equal but as I said in the first post if it was my decision I'd probably also choose Enter. :)