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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - spike.barnett

Pages: [1]
1
Window / Re: Key detection issues.
« on: May 30, 2014, 10:51:28 am »
It's a known problem that keyboard handling is imperfect, and we're currently investigating how to improve it (scancodes will play an important role).

Thank you for the information Nexus.

2
Window / Re: Key detection issues.
« on: May 30, 2014, 10:10:00 am »
I've written a minimal program to demonstrate this. When the afore mentioned keys are pressed, a value of -1 is returned.

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

int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
        window.setActive();

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            switch (event.type)
            {
                case sf::Event::Closed : window.close(); break;
                case sf::Event::KeyPressed : std::cout << event.key.code << "\n"; break;
                        }
                }
                window.clear();
                window.display();              
        }
        return 0;
}

3
Window / Key detection issues.
« on: May 30, 2014, 09:45:01 am »
I'm seeing similar key detection issues to those referenced in:
http://en.sfml-dev.org/forums/index.php?topic=10393.0

I'm using an American English QWERTY keyboard with the most recent SFML package in the Arch Linux repos (sfml 2.1.0.4a300547f3-1).

SFML recognises that a key was pressed, but can not identify the key. This only occurs with the grave(tilde), apostrophe(quote), and numpad delete(numpad decimal) keys. I've placed my xev output below in case it helps. If it doesn't, by all means, let me know how I can provide more helpful information.


KeyPress event, serial 48, synthetic NO, window 0x1e00001,
    root 0x25c, subw 0x1e00002, time 1733558415, (44,21), root:(1245,377),
    state 0x10, keycode 49 (keysym 0x60, grave), same_screen YES,
    XLookupString gives 1 bytes: (60) "`"
    XmbLookupString gives 1 bytes: (60) "`"
    XFilterEvent returns: False

KeyPress event, serial 48, synthetic NO, window 0x1e00001,
    root 0x25c, subw 0x0, time 1733518200, (-407,111), root:(794,467),
    state 0x10, keycode 48 (keysym 0x27, apostrophe), same_screen YES,
    XLookupString gives 1 bytes: (27) "'"
    XmbLookupString gives 1 bytes: (27) "'"
    XFilterEvent returns: False

KeyPress event, serial 48, synthetic NO, window 0x1e00001,
    root 0x25c, subw 0x0, time 1733614262, (36,125), root:(1237,481),
    state 0x10, keycode 91 (keysym 0xffae, KP_Decimal), same_screen YES,
    XKeysymToKeycode returns keycode: 129
    XLookupString gives 1 bytes: (2e) "."
    XmbLookupString gives 1 bytes: (2e) "."
    XFilterEvent returns: False

Pages: [1]