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 - Rhubarb

Pages: [1]
1
General / Check if SFML is installed
« on: June 23, 2024, 09:06:21 pm »
Hello, is there any #ifdef to check if libsfml-dev is installed? Thanks.

2
General / Re: Keyboard big issue
« on: May 30, 2024, 03:47:37 pm »
UPDATE:

I fixed the problem by modifying my function:

int isPressed(sf::Event event,sf::Keyboard::Key key){
    if (sf::Keyboard::isKeyPressed(key)&&function_done==0){
        function_done=1;
        return 0;
    };
    if(event.type == (sf::Event::KeyReleased)){
        if (event.key.code == key&&function_done==1){
            function_done=0;
        }else
            if (!(sf::Keyboard::isKeyPressed(key))){
                function_done=0;
            };
    };
    return 1;
};

So it fixed two problems:

now letters works
and now it works instantly because before you needed to input the key at least once before it works because the function was calling the keyrealsed event :)

thanks for the help also :)

3
General / Re: Keyboard big issue
« on: May 30, 2024, 08:56:48 am »
I'm using Xlib, x11 to be more precise

4
General / Re: Keyboard big issue
« on: May 29, 2024, 09:34:39 am »
I'm using SFML 2.6

5
General / Re: Keyboard big issue
« on: May 28, 2024, 10:24:16 pm »
I did this, and no letters are detected.
if(event.type == (sf::Event::KeyPressed)){
    std::cout << rand()%255 << std::endl;
};
 
Only functions keys, top keyboard numbers and some keys like "inser" "end" "page up" "page down" etc
The problem is also maybe because I have an french Azerty keyboard.

6
General / Re: Keyboard big issue
« on: May 28, 2024, 04:35:34 pm »
I installed SFML with apt-get so I have the 2.6 (I guess?) and I don't know why but the event.code you gave me doesn't work

7
General / Re: Keyboard big issue
« on: May 28, 2024, 04:11:52 pm »
Yes, that's exactly that I tried O,P,C,A,V none worked, so I assume none letter is working.
And I just love semicolons lol

8
General / Re: Keyboard big issue
« on: May 28, 2024, 03:30:40 pm »
Yes, I have a function thats takes input once, and not every frames here it is:
int isPressed(sf::Event event,sf::Keyboard::Key key){
    if(event.type == (sf::Event::KeyPressed)){
        if (event.key.code == key&&function_done==0){
            function_done=1;
            return 0;
        };};
        if(event.type == (sf::Event::KeyReleased)){
            if (event.key.code == key&&function_done==1)function_done=0;
    };
    return 1;
};

So it works with all keys I mentionned above but not with letters.

9
General / Keyboard Press Once [SOLVED]
« on: May 28, 2024, 02:47:30 pm »
Hello, this is my first post here, so I don't know if it's the right place to ask, but I have an issue with SFML.
The "sf::Keyboard::" works, but only with the F1 to F12 and with Num1 to Num0, it doesn't works with the letters or anything else, I don't know why.

Thanks if you can help, you can answer in french.

edit:
I work with VSCode on Debian 12 and I build with g++

Pages: [1]