Unity Fire 1 Mouse Button Assignments

Controller Input with Unity

You can use the Unity development tools to create apps and games for Amazon Fire TV devices as you would any Android device.

Although we do not provide a Unity plugin for Fire TV development, there are packages in the Unity Asset Store to enable game controller support. In particular, InControl by Gallant Games is one with which our developers have had great success. InControl is a cross-platform input manager for Unity3D that standardizes control mappings for a variety of common controllers.

You can also use the Unity input manager to configure controller input for your game. Use the tables below to map the buttons on the Amazon Fire TV remotes and game controllers with the Unity input manager buttons and axes.

Note: The input references in this document apply to Unity 4.3.x and higher, but are subject to change with future Unity releases.

Remote Control Input

Use these values in Unity to map the buttons on both the Amazon Fire TV Remote and Voice Remote. See KeyCode for more details about Unity KeyCode values.

The remote for Fire TV Edition has some additional buttons — volume up/down, power, Netflix, Amazon Music, and Amazon Prime. However, these buttons can't be mapped to events in third-party apps, so the buttons shown in the above Fire TV remote are effectively the same available buttons for Fire TV Edition's remote, even if the remotes look a bit different.

ButtonUnity Input Manager ValueUnity KeyCode Value
Homeone (system event)none (system event)
Backnone (not supported)
Menunone (not supported)
Microphone (Search)none (system event)none (system event)
Select (D-Pad Center)joystick button 0
Left (D-Pad)5th Axis
Right (D-Pad)5th Axis
Up (D-Pad)6th Axis
Down (D-Pad)6th Axis
Play/Pausenone (not supported)none (not supported)
Rewindnone (not supported)none (not supported)
Fast Forwardnone (not supported)none (not supported)

Game Controller Input

Use these values in Unity to map the buttons on the Amazon Fire Game Controller. See KeyCode for more details about Unity KeyCode values.

The current version of the Fire TV Game Controller has these buttons:

The previous version of the Game Controller has these buttons:

Game Controller ButtonUnity Input Manager ValueUnity KeyCode Value
Homenone (system event)none (system event)
Backnone (system event)
Menunone (system event)
GameCirclenone (system event)none (system event)
Ajoystick button 0
Bjoystick button 1
Xjoystick button 2
Yjoystick button 3
Left (D-Pad)5th Axisnone
Right (D-Pad)5th Axisnone
Up (D-Pad)6th Axisnone
Down (D-Pad)6th Axisnone
Left Stick (Left/Right)X Axis 1st Axisnone
Left Stick (Up/Down)Y Axis 2nd Axisnone
Left Stick Pressjoystick button 8
Right Stick (Left/Right)3rd Axisnone
Right Stick (Up/Down)4th Axisnone
Right Stick Pressjoystick button 9
Play/Pause (1st version only)none (not supported)none (not supported)
Rewind (1st version only)none (not supported)none (not supported)
Fast Forward (1st version only)none (not supported)none (not supported)
Left Trigger (L2)13th Axisnone
Left Shoulder (L1)joystick button 4
Right Trigger (R2)12th Axisnone
Right Shoulder (R1)joystick button 5

Controller Names

Controller names are available in Unity with the method. Use these values for each controller:

  • Remote:
  • Voice Remote:
  • Game controller:

For those of you who like to do your programing on a Mac lapTop, Unity may not be the best solution. The Unity Software uses all the standard Key clicks that you are used to when using mac, or LapTops, but several (most) of the developers of the assets you will run into, seem to either not take Mac into account, or restrict it on purpose (not sure why they would do this).

Mac uses a single button mouse. PC uses 2-8 button mouse, with most using 3. Mac adapts to this with Ctrl-Click. Ctrl-Click serves the same purpose as Right-Click on a PC mouse. 99.99% of software ported to Mac, uses this solution.

I have downloaded several (over 10) assets from the Unity Asset Store, and had most fail on my lapTop (MacBook Pro), due to non-responsive clicks. The assets allow me to Click on something, but when it requires a Right-Click, the standard Ctrl-Click (you would use on Mac), is not accepted.

To get around this, you need to mess with the Input Receiver Scripts that come with the asset. There are several on the assets store, and (so far) not one is just drag-and-drop. All require you to edit the script so that it will work for whatever asset you want to use. This gets VERY frustrating when downloading multiple assets, to figure out which works best for your needs. When just fighting the Click, I never get to see the full functionality of what their asset can do.

The simple work-around (not so simple), is to use a 2+ button USB mouse. But… this kills the idea of working on a lapTop. You now need to carry around a mouse, and have a surface you can use it on.

In Unity's top menu: Edit->Project Settings->Input

file:///Applications/Unity/Unity.app/Contents/Documentation/html/en/Manual/class-InputManager.html

file:///Applications/Unity/Unity.app/Contents/Documentation/html/en/Manual/ConventionalGameInput.html

In the input Manager you can change settings for each “action”. There is a Positive Button and an Alt Positive button. Both of these can be use independently. "Fire 1” Positive Button is set to "left ctrl”. "Fire 1” Alt Positive Button is set to “mouse 0” <—— left mouse click..... So if you hit the left control key OR use the trackPad/Left-Mouse-Button, this will activate Fire 1. I can not find a way to have multiple buttons in this list. For instance, I can not set "Fire 1” Positive Button to "left ctrl + mouse 0” Can not find any documentation on this.

…anyway … In whatever input script you have for your game, find a line that looks like this:

if (Input.GetMouseButtonDown(1))

And change it to:

if (Input.GetButtonDown(“Fire1"))

This will make it use whatever button you assigned in the inputManager calls the action.

OR….

In that same script, replace the line of code

if (Input.GetMouseButtonDown(1))

with:

if (Input.GetKey("left ctrl") && Input.GetMouseButtonDown(0))

This will make it so you must use the Left Control Click AND the trackPad/Left-Mouse-Button. This will make it so every mac user can continue to use the asset as normal, where Ctrl-click is the same a s Right-MouseButton click.

If you want to get fancy, and tend to use Mac and PC for doing your programing…

if (Input.GetKey("left ctrl") && Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1))

The || is the same as an OR statement.

Of course, later, when you port over to your mobile device, you’ll have to create those inputs, but that will be later, after you tested your assets, and know what you want your game to do.

Hope this helps.

If anyone knows how to put multiple key combinations in the input manager, please let me know.

Thanks.

Some other good resources for this:

https://blog.safaribooksonline.com/2013/11/26/managing-player-input-in-unity/

http://wiki.unity3d.com/index.php?title=Basic_iOs_Input_Tutorial

http://answers.unity3d.com/questions/553618/how-can-i-use-multiple-getbuttondown-keys-simultan.html

file:///Applications/Unity/Unity.app/Contents/Documentation/html/en/Manual/ConventionalGameInput.html

button values are 0 for left button, 1 for right button, 2 for the middle button. http://docs.unity3d.com/ScriptReference/Input.GetMouseButton.html

0 Replies to “Unity Fire 1 Mouse Button Assignments”

Lascia un Commento

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *