Detect when a button is released #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
Thanks for this library. Seems great!
I do not have a Nintendo Wii right now with me so I cannot test anything. But reading the documentation and looking at the source code I do not see a way to check whether a button has been released or not. This is very important for games. I am developing a game engine framework that will probably use your library to support Wii if you do not mind (showing your name in the credits, of course).
The events are named "pressed_a", etc. but what about "released_a", etc.?
I need a way to access to every controller's object at any time and be able to check whether a chosen button (or even more than one) is being pressed or not. I am not sure, but I guess the "hold" property (from the "official" Wii JS API), which is a bitmask, could be useful here. But I cannot even find the official documentation about using JavaScript with the old Wii console (I can only find it about the new Wii U).
My idea is to have the following array (just a simplified example):
That array just holds all the possible four controllers as an object and every of those objects holds the status of the corresponding buttons. In the beginning, all values should be set to false/undefined. Now I want to use your library to update the array using the following way:
Obviously, the code above could be in a loop for the four controllers. That is not important now.
Please, could you tell me how I could use your library to update the values of that array and set the buttons to "false" when the button is released?
I am sorry about the long message. Thank you very much for all!
Regards,
Joan
Heya,
Yeah, so you'd need to probably alter the library to...
upvariant of events. Only controller 1 gets these for whatever reason.Wii.listenevent slightly to detect when a release has occurred.The specifics of this would take me awhile to get back into as I've not touched the library in 5 years, but feel free to reach out again if you have issues!
Hello again,
Thank you very much for your answer.
So I guess to access the controller #1 status we just need to manage the key events fired and the other controllers use the Nintendo Wii API in JavaScript to expose their status. I am not sure about that.
It is difficult to me to modify the library without knowing too much about the Nintendo WII API (I guess it can be similar to the WII U API which also uses bitmasks but not totally equal) and without having a real Nintendo Wii console to test, but if I find some time and an old console maybe I will try to do it (just need to know when buttons are released).
Thank you very much,
Joan