-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlight key being pressed when not in mapping mode #6
Comments
Note that you can't do the "have an svg for every key" trick here, as you can press multiple keys at once. :p |
in Games we use a drawing area + render the svg via librsvg. First just render it, then for every pressed button { take its corresponding svg element, and render it masking with another color }. |
Yeah, that makes it quite a bit more difficult |
I noticed that there was only one gamepad SVG file in Games. Wasn’t sure how you guys worked with it to highlight buttons. I’ve seen librsvg on the valadoc website, but haven’t gotten an excuse to really look into it. Now I do! |
This is mostly working as of right now. Issues being seen:
|
Typo: |
Whoops! |
So, why analogs are not working well:
What if X axis changed to 0.9 and then Y axis changed to 0.1? You should either track status of both or change how it's displayed not to use the same element. |
But given you already have a circle when mapping, I'd suggest to move it around according to the axis position and make it red when you press it. |
Also, And |
I don't think so. I'm looking at the SVG Id's and the order of the HighlightId's, and they match.
|
Do you seriously have a button that says "Press Escape" and can't be clicked? 🤣️ The reason home button is not working is because it's not mapped correctly. |
Hence why it's commented out. I should remove that, though |
...It can't be clicked? |
Wait, it can? Then there's a bug somewhere. |
The button can be clicked |
Aha, if you try to set up a controller again without closing the window, it doesn't work. |
And I can't figure out how to map analog sticks, or it's bugged. |
Checked with a mapping from Games, that's what it is indeed. |
If you're referring to it not showing you which direction to go, yeah, that's what I was meaning:
|
This is a me issue? |
This is kinda what I was meaning when I was saying "I don't know how to do that properly." I'm not sure how to move that. |
Ah, ok. Well, the easiest way is to split the stick indicators into 2, one for vertical and one for horizontal. But I think it would be better to move a circle. |
|
Would that not translate the entire context? |
Yes. I mean it's working with a mapping produced in Games, so you don't produce a correct mapping. :) |
Oh fun. I'll have to see what's going on there, then |
|
Actually not even that. You already have |
Oh, duh. That's the reason why it doesn't make the entire thing red 🤦♂️ |
For my own notes:
|
Once I get that last part done, I should be able to remove all of those extra SVG files too! |
I opened an issue to do the translation part in Games too, what we do currently is pretty lame. |
Think I've got this done. It's a little weird, as it shows a stick for each axis, but it works |
It's hard for me to reimplement your code since I don't implement |
Reopening this because those analog sticks are still way off |
Well, analog_paths are added in that MR in the first place. Just showing that it can be done really. |
The earlier version I had (Where I was treating each analog direction independently) was fairly accurate, so I tried to use the offsets those were giving me to create an X and Y offset to make it more reflective of where the actual analog stick was. That created inaccuracies (pushing the analog stick directly left would not put the on-screen stick directly left) |
No clue why if only one axis active it still shows the white circle in the middle, though |
🤣️ You are supposed to use those X and Y offsets directly, yes. |
The current iteration tried to do things more efficiently, but ends up doing the same thing as the version where they are being dealt with independently. I think it has to do with:
I'm currently dealing with the analogs' x and y separately. However, if I simply comment out those regions, it doesn't help. I think there will need to be some refactoring of the code to get this to work right |
Well yh, I did refactor my code a lot to do that. |
Originally posted by @Exalm in #4 (comment)
The text was updated successfully, but these errors were encountered: