Input controls

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.

The poor performers

A keyboard connected to a Blu-ray player (if the device even supports a keyboard) generally fires KEY_PRESSED and KEY_RELEASED 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.

In the group of poor performers we sadly also find the Xbox One gamepad, which also only lets you press a single button at a time. So again this means you can't go UP + LEFT. If you hold UP and you press LEFT, it will go LEFT and cancel UP.

The great performers

The PlayStation 3 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 (CrossSquareL1R1L2R2).

The PlayStation 4 gamepad is the clear winner on the list: It lets you hold all (supported) buttons and only fires KEY_RELEASED when you actually release them. You can go UP + LEFT while pressing any other (supported) button (CrossSquareCircleL1R1L2R2).

In the group of great performers we also have the Blu-Pads, which comes in 2 versions:

Both of these are great performers, equal to the PlayStation 4 gamepad. But the Adapter version isn't supported on all devices. It only works on devices that also supports a USB keyboard.

The WiFi version runs on all platforms you can think of, as long as the device and the phone is connected to the same LAN.

But before your players can play your game using any of the Blu-Pad options, you have to add support for them in your game. Some source files will be downloadable from this site in the near future.

Categories

Based on these facts we can divide user-input into 3 groups:

Class 1: Holdable multiple buttons

The 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 - although the PS3 gamepad only lets you press one directional button at a time.

Class 2: Holdable single button

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.

Class 3: Clickable single button

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.

Overview

 Class 1:
Holdable
multiple
buttons
Class 2:
Holdable
single
button
Class 3:
Clickable
single
button
PlayStation 3DualShock III *1
Blu-Pad Adapter
Blu-Pad WiFi
USB keyboard
PlayStation 4DualShock 4
Blu-Pad Adapter
Blu-Pad WiFi
USB keyboard
Xbox OneBlu-Pad Adapter
Blu-Pad WiFi
Xbox Controller
Blu-ray playerBlu-Pad Adapter
Blu-Pad WiFi
Remote control
DualShock 4 v1 *2
USB keyboard
Dune HD Smart D1Blu-Pad Adapter
Blu-Pad WiFi
Remote control
PowerDVDKeyboard
Blu-Pad Adapter
Blu-Pad WiFi
VLCKeyboard

1 The DualShock III 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.

Suitable game types

The limited user-input options for Xbox One and standard Blu-ray players means there are certain game-types you can only create for the PlayStation 3 and 4 - if you want to stick with standard controllers.

In order for your game to be playable on Xbox One and standard Blu-ray players (without using the Blu-Pads), it needs to require only one button press 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 the phone into a touchpad, and/or make the game react to the phone accelerometer.

Keycodes

Here you can see an overview of the buttons on the gamepads and their corresponding keycodes.

PlayStation 3PlayStation 4Xbox OneKeycodeRemote control
LeftLeftLeft37Left
UpUpUp38Up
RightRightRight39Right
DownDownDown40Down
CrossCrossA button10Enter / Select
SquareSquareMenu button461Popup Menu
Not supportedCircleX button19Pause
StartNot supported415Play
L1L1LB424Previous track
R1R1RB425Next track
L2L2LT412Rewind
R2R2RT417Fast forward

Gamepad buttons placement

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 square button is mapped to keycode 461. If the buttons should match on the Xbox One gamepad, then the X button should have had the same keycode, but it doesn't. Instead, the X 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 circle button, which is placed to the upper right in relation to the cross button - i.e. the opposite side as the X button relative to the A 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 square button on the PlayStations and the X button on the Xbox One does the same thing. This of course also means that both the square button and the circle 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.