You have a few options for input controls, when making a Blu-Play game.
What you should know about these different options, is that they behave differently on different platforms. Some with poor performance, others with great performance.
A keyboard connected to a Blu-ray player (if the device supports a keyboard) generally fires both KEY_PRESSED and KEY_RELEASED at the same time the instant you press a key, regardless of whether you actually released the key again or not.
The remote control does it better: It waits firing KEY_RELEASED till you actually release the key - as it should.
A keyboard connected to a PlayStation 3 or 4 will give the same behavior as a remote control connected to a Blu-ray player though.
But both the keyboard and the remote control only lets you press a single button at a time.
This means you can't press UP + LEFT for example. If you hold UP and you press LEFT, you will just continue going UP.
Sadly, we also find the gamepad for both the Xbox One and the Xbox Series X in the group of poor performers. On these consoles, the gamepad also only lets you press a single button at a time - and it's not even possible to hold the button! (It calls keyReleased instantly, despite you not actually releasing it. Go Microsoft!).
The PlayStation 3 and 4 gamepad is a lot better: It lets you hold down several buttons at the same time, and only calls KEY_RELEASED when you actually release them - as it should. Unfortunately this doesn't apply to the directional buttons for some reason. Here again you can only press one directional button at a time. This means you can't press UP + LEFT - but you can press UP + any other non-directional (supported) button ().
If you don't find any of the above options good enough, you also have the option of using a Blu-Pad: A software app that lets you use your cellphone, tablet or even computer as a virtual gamepad.
The Blu-Pad is a great performer. It runs on all platforms you can think of, as long as the player/console and the phone/tablet is connected to the same LAN.
In order to use a Blu-Pad for your game, you must add support for it in your game. Some helpful source files will be available on this site in the near future.
Based on these facts we can divide user-input into 3 groups:
This is the most optimal user-input we can get. You can register multiple buttons. KEY_PRESSED will be fired for each button as the player press and hold them one by one. When you release them one by one, KEY_RELEASED will be fired for each of them too. So this class of input-controls really has no limits. Devices in this category includes the PS4 gamepad, and the PS3 gamepad.
Suitable game types: All kinds.
There's a big step down from a Class 1 to a Class 2 input-control device. Devices in this category only lets you press a single button at a time. It fires KEY_PRESSED when you press the button, and KEY_RELEASED when you lift your finger again.
Suitable game types: Simple arcade games like Arkanoid, or space shooters with auto-fire.
The absolute worst class of input-control you can find is the class 3: Only a single button can be pressed - and not held down. KEY_PRESSED and KEY_RELEASED is both fired the instant you press the button. So there's no way of knowing when the user actually releases the button.
Suitable game types: Most puzzle games, like Tetris, and "auto-moving" arcade games, like Snake and Pacman.
Class 1: Holdable multiple buttons | Class 2: Holdable single button | Class 3: Clickable single button | |
PlayStation 3 | DualShock III *1 Blu-Pad WiFi | USB keyboard | |
PlayStation 4 | DualShock 4 *1 Blu-Pad WiFi | USB keyboard | |
PlayStation 5 | DualShock 5 *1 Blu-Pad WiFi | USB keyboard | |
Xbox One | Blu-Pad WiFi | Xbox Controller | |
Xbox Series X | Blu-Pad WiFi | Xbox Controller | |
Blu-ray player | Blu-Pad WiFi | Remote control DualShock 4 v1 *2 | USB keyboard |
Dune HD Smart D1 | Blu-Pad WiFi | Remote control | |
PowerDVD | Keyboard Blu-Pad WiFi | ||
VLC | Keyboard |
1 The DualShock's only lets you press one directional button at a time. But you can press all other buttons at the same time too.
2 The DualShock 4 v1 can be connected to certain Blu-ray players. See platforms.
The limited user-input options for Xbox and standard Blu-ray players means there are certain game-types you can only create for the PlayStation's - if you want to stick with standard controllers.
In order for your game to be playable on Xbox and standard Blu-ray players (without using the Blu-Pads), it needs to require only one button click at a time.
Luckily there are many game-genres that can be done under those requirements. Tetris and Snake comes to mind. But you're free to choose to only target the PlayStation consoles.
If you add Blu-Pad support for your game though, you're pretty much limitless. You can even develop your own input controls using the same technique as the Blu-Pads. For example, turn your phone into a touchpad, and/or make the game react to the phone accelerometer.
Here you can see an overview of the buttons on the gamepads and their corresponding keycodes.
PlayStation 3 | PlayStation 4 | Xbox One | Keycode | Remote control |
37 | Left | |||
38 | Up | |||
39 | Right | |||
40 | Down | |||
10 | Enter / Select | |||
461 | Popup Menu | |||
Not supported | 19 | Pause | ||
Start | Not supported | 415 | Play | |
424 | Previous track | |||
425 | Next track | |||
412 | Rewind | |||
417 | Fast forward |
As you can see, most buttons on the gamepads share the same locations and keycodes. There are a few exceptions though:
On PlayStation 3 and 4, the button is mapped to keycode 461. If the buttons should match on the Xbox One gamepad, then the button should have had the same keycode, but it doesn't. Instead, the button on the Xbox One gamepad is mapped to keycode 19. The button assigned to keycode 461 is the menu () menu button, which is placed too far away to be useful in a game.
On PS4 keycode 19 is assigned to the button, which is placed to the upper right in relation to the button - i.e. the opposite side as the button relative to the button on the Xbox One. Meanwhile, the PS3 doesn't even have a button mapped to keycode 19.
One solution, if you wish to give the same controls on both platforms, is to assign both keycode 461 and 19 to the same action in your game. That way, the button on the PlayStations and the button on the Xbox One does the same thing. This of course also means that both the button and the button does the same thing on the PlayStation 4.
Another solution is to offer a "Redefine control buttons" option in your game. That way your players can decide for themselves what buttons to use.