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

Author Topic: NumpadDecimalPoint/NumpadPeriod missing??  (Read 5248 times)

0 Members and 1 Guest are viewing this topic.

jgreene

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
NumpadDecimalPoint/NumpadPeriod missing??
« on: August 25, 2015, 05:06:18 pm »
It could be me, but I see no Keyboard Key definition for NumpadPeriod and a project I'm working on is not recognizing said key as a result either.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #1 on: August 25, 2015, 06:01:21 pm »
Do you get an event (of type sf::Event::KeyPressed) at all when you press the key?
If yes, what are the values of the .key.* members?

What SFML version are you using?
What OS are you using?
What keyboard are you using?
What (language) keyboard layout are you using?

In the future, reading the following link would help you produce better bug reports/questions: How To Ask Questions The Smart Way ;)
« Last Edit: August 25, 2015, 06:10:43 pm by Jesper Juhl »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #2 on: August 25, 2015, 06:51:13 pm »
The full-stop/decimal-point/period on the number pad doesn't have its own value in the enum.
On my keyboard, it returns -1 (unknown key) unless number lock is off, where it returns 66 (delete).

There are few keys still missing from the enum. That is one and ` is another, which I've missed most of all  :P
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

jgreene

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #3 on: August 25, 2015, 07:00:32 pm »
SFML Version 2.3.x fresh pull from Git (<24hours old)
Fedora 22 custom spin (which I'm developing) both i686 and x86_64  builds see the issue Kernel 4.1.5-200
101 Key USB Keyboard, various laptop keyboards.
All QWERTY US Keyboards.

I'll have to figure out how to determine the answer to that first question set. I would presume I do get an event as it is a standard key. usually found to the right of  the standard US 101key keyboard Numpad0 key. My apologies for my somewhat amateur approach to this as I'm a systems admin and have not performed any deep coding in nearly 15 years, so I'm more than a scoche rusty. Oddly  the use of the other numpad non numeric keys seems to function as expected within the application (EmptyEpsilon/SeriousProton) that I am attempting to crawl  down into the code of... +-*/ all work..  but . on the keypad does not. I'm working on tearing into the code and disassembling things from the wrong direction (top down to the detailed breakdown) to trace it. Looking at the SFML Keyboard::Key enum I noticed the absence of that particular key which seems to be the remaining multifunction US layout keypad key.
« Last Edit: August 25, 2015, 07:04:40 pm by jgreene »

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #4 on: September 01, 2015, 02:00:25 pm »
Chances are high, it's just not implemented in SFML's event handling. Haven't had time to take a look, but if you need specific (common) keys and they're not in the sf::Key enum, let us know, and we can add them. :)

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #5 on: September 01, 2015, 06:06:46 pm »
My suggestion would be to add these to the enum:
  • ` (back tick/quote)
  • Period/Decimal Point (number pad)
  • Caps Lock
  • Scroll Lock
  • Number Lock
  • 5 (number pad, when number lock is not active)

These are all common, right? They return -1/Unknown.

I avoided Print Screen as it doesn't return anything at all and there has definitely been a discussion about this specific key already.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #6 on: September 01, 2015, 09:07:30 pm »
Backtick/quote might be layout specific - not 100% sure though.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #7 on: September 01, 2015, 10:57:05 pm »
In a global world, almost any key is layout specific.
Most US people seem to assume that most keyboard layouts are vaguely US like with slight variations (like something like a Danish keyboard). But then they discover things like Armenian keyboards and other excentric layouts and realize that you really cannot assume anything about what a keyboard layout looks like ;)

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: NumpadDecimalPoint/NumpadPeriod missing??
« Reply #8 on: September 02, 2015, 01:05:53 am »
Looks like Caps Lock is at least as common as A;D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything