<commit_before>﻿/*
 * Copyright (C) 2012, 2013 OUYA, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using UnityEngine;

public class OuyaExampleCommon
{
    /// <summary>
    /// The current selected controller
    /// </summary>
    public static OuyaSDK.OuyaPlayer Player = OuyaSDK.OuyaPlayer.player1;

    /// <summary>
    /// Cache joysticks
    /// </summary>
    public static string[] Joysticks = null;

    /// <summary>
    /// Query joysticks every N seconds
    /// </summary>
    private static DateTime m_timerJoysticks = DateTime.MinValue;

    #region Mapping Helpers

    public static float GetAxis(string ouyaMapping, OuyaSDK.OuyaPlayer player)
    {
        switch (ouyaMapping)
        {
            case "LB":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_LB, player);
            case "LT":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_LT, player);
            case "LX":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_LSTICK_X, player);
            case "LY":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_LSTICK_Y, player);
            case "RB":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_RB, player);
            case "RT":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_RT, player);
            case "RX":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_RSTICK_X, player);
            case "RY":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_RSTICK_Y, player);
            case "DL":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT, player);
            case "DR":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT, player);
            case "DU":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_UP, player);
            case "DD":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN, player);
            default:
                return 0f;
        }
    }

    public static float GetAxis(OuyaSDK.KeyEnum keyCode, OuyaSDK.OuyaPlayer player)
    {
        if (null == OuyaExampleCommon.Joysticks)
        {
            return 0f;
        }
        int playerIndex = (int)player - 1;
        if (playerIndex >= OuyaExampleCommon.Joysticks.Length)
        {
            return 0f;
        }

        string joystickName = OuyaExampleCommon.Joysticks[playerIndex];
        if (null == joystickName)
        {
            return 0f;
        }

        bool invert = false;
        string axisName = string.Empty;

        switch (joystickName.ToUpper())
        {
            case "HARMONIX ROCK BAND DRUMKIT":
                return 0f;
            case "HARMONIX ROCK BAND GUITAR":
                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.HARMONIX_ROCK_BAND_GUITAR_PICKUP:
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 3", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.HARMONIX_ROCK_BAND_GUITAR_WHAMMI:
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.HARMONIX_ROCK_BAND_GUITAR_STRUM:
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        axisName = string.Format("Joy{0} Axis 8", (int)player);
                        break;
                    default:
                        return 0f;
                }
                break;

            case "BROADCOM BLUETOOTH HID":
            case "MOGA PRO HID":
#if !UNITY_EDITOR && UNITY_ANDROID
            switch (keyCode)
            {
                case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                    axisName = string.Format("Joy{0} Axis 1", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 2", (int)player);
                    invert = true;
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                    axisName = string.Format("Joy{0} Axis 3", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 4", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_LT:
                    axisName = string.Format("Joy{0} Axis 8", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_RT:
                    axisName = string.Format("Joy{0} Axis 7", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                    axisName = string.Format("Joy{0} Axis 5", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                    axisName = string.Format("Joy{0} Axis 5", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                    axisName = string.Format("Joy{0} Axis 6", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                    axisName = string.Format("Joy{0} Axis 6", (int)player);
                    break;
                default:
                    return 0f;
            }
#endif
                break;
            case "OUYA GAME CONTROLLER":

#if !UNITY_EDITOR && UNITY_ANDROID
            switch (keyCode)
            {
                case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                    axisName = string.Format("Joy{0} Axis 1", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 2", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                    axisName = string.Format("Joy{0} Axis 3", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 4", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_LT:
                    axisName = string.Format("Joy{0} Axis 5", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_RT:
                    axisName = string.Format("Joy{0} Axis 6", (int)player);
                    break;
                default:
                    return 0f;
            }
#else
                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                        axisName = string.Format("Joy{0} Axis 1", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 2", (int)player);
                        invert = true;
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        invert = true;
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 9", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 10", (int)player);
                        break;
                    default:
                        return 0f;
                }
#endif
                break;

            case "XBOX 360 WIRELESS RECEIVER":
            case "CONTROLLER (AFTERGLOW GAMEPAD FOR XBOX 360)":
            case "CONTROLLER (ROCK CANDY GAMEPAD FOR XBOX 360)":
            case "CONTROLLER (XBOX 360 WIRELESS RECEIVER FOR WINDOWS)":
            case "MICROSOFT X-BOX 360 PAD":
            case "CONTROLLER (XBOX 360 FOR WINDOWS)":
            case "CONTROLLER (XBOX360 GAMEPAD)":
            case "XBOX 360 FOR WINDOWS (CONTROLLER)":
            case "MICROSOFT WIRELESS 360 CONTROLLER":

#if !UNITY_EDITOR && UNITY_ANDROID

                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                        axisName = string.Format("Joy{0} Axis 1", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 2", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                        axisName = string.Format("Joy{0} Axis 3", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 8", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        break;
                    default:
                        return 0f;
                }

#else

                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                        axisName = string.Format("Joy{0} Axis 1", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 2", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 9", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 10", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        invert = true;
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        invert = true;
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    default:
                        return 0f;
                }
#endif

                break;

            case "": //the driver is reporting the controller as blank<commit_msg>The dpads on Windows were inverted for left and right.<commit_after>﻿/*
 * Copyright (C) 2012, 2013 OUYA, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using UnityEngine;

public class OuyaExampleCommon
{
    /// <summary>
    /// The current selected controller
    /// </summary>
    public static OuyaSDK.OuyaPlayer Player = OuyaSDK.OuyaPlayer.player1;

    /// <summary>
    /// Cache joysticks
    /// </summary>
    public static string[] Joysticks = null;

    /// <summary>
    /// Query joysticks every N seconds
    /// </summary>
    private static DateTime m_timerJoysticks = DateTime.MinValue;

    #region Mapping Helpers

    public static float GetAxis(string ouyaMapping, OuyaSDK.OuyaPlayer player)
    {
        switch (ouyaMapping)
        {
            case "LB":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_LB, player);
            case "LT":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_LT, player);
            case "LX":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_LSTICK_X, player);
            case "LY":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_LSTICK_Y, player);
            case "RB":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_RB, player);
            case "RT":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_RT, player);
            case "RX":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_RSTICK_X, player);
            case "RY":
                return GetAxis(OuyaSDK.KeyEnum.AXIS_RSTICK_Y, player);
            case "DL":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT, player);
            case "DR":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT, player);
            case "DU":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_UP, player);
            case "DD":
                return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN, player);
            default:
                return 0f;
        }
    }

    public static float GetAxis(OuyaSDK.KeyEnum keyCode, OuyaSDK.OuyaPlayer player)
    {
        if (null == OuyaExampleCommon.Joysticks)
        {
            return 0f;
        }
        int playerIndex = (int)player - 1;
        if (playerIndex >= OuyaExampleCommon.Joysticks.Length)
        {
            return 0f;
        }

        string joystickName = OuyaExampleCommon.Joysticks[playerIndex];
        if (null == joystickName)
        {
            return 0f;
        }

        bool invert = false;
        string axisName = string.Empty;

        switch (joystickName.ToUpper())
        {
            case "HARMONIX ROCK BAND DRUMKIT":
                return 0f;
            case "HARMONIX ROCK BAND GUITAR":
                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.HARMONIX_ROCK_BAND_GUITAR_PICKUP:
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 3", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.HARMONIX_ROCK_BAND_GUITAR_WHAMMI:
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.HARMONIX_ROCK_BAND_GUITAR_STRUM:
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        axisName = string.Format("Joy{0} Axis 8", (int)player);
                        break;
                    default:
                        return 0f;
                }
                break;

            case "BROADCOM BLUETOOTH HID":
            case "MOGA PRO HID":
#if !UNITY_EDITOR && UNITY_ANDROID
            switch (keyCode)
            {
                case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                    axisName = string.Format("Joy{0} Axis 1", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 2", (int)player);
                    invert = true;
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                    axisName = string.Format("Joy{0} Axis 3", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 4", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_LT:
                    axisName = string.Format("Joy{0} Axis 8", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_RT:
                    axisName = string.Format("Joy{0} Axis 7", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                    axisName = string.Format("Joy{0} Axis 5", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                    axisName = string.Format("Joy{0} Axis 5", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                    axisName = string.Format("Joy{0} Axis 6", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                    axisName = string.Format("Joy{0} Axis 6", (int)player);
                    break;
                default:
                    return 0f;
            }
#endif
                break;
            case "OUYA GAME CONTROLLER":

#if !UNITY_EDITOR && UNITY_ANDROID
            switch (keyCode)
            {
                case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                    axisName = string.Format("Joy{0} Axis 1", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 2", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                    axisName = string.Format("Joy{0} Axis 3", (int)player);
                    break;
                case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                    axisName = string.Format("Joy{0} Axis 4", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_LT:
                    axisName = string.Format("Joy{0} Axis 5", (int)player);
                    break;
                case OuyaSDK.KeyEnum.BUTTON_RT:
                    axisName = string.Format("Joy{0} Axis 6", (int)player);
                    break;
                default:
                    return 0f;
            }
#else
                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                        axisName = string.Format("Joy{0} Axis 1", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 2", (int)player);
                        invert = true;
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        invert = true;
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 9", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 10", (int)player);
                        break;
                    default:
                        return 0f;
                }
#endif
                break;

            case "XBOX 360 WIRELESS RECEIVER":
            case "CONTROLLER (AFTERGLOW GAMEPAD FOR XBOX 360)":
            case "CONTROLLER (ROCK CANDY GAMEPAD FOR XBOX 360)":
            case "CONTROLLER (XBOX 360 WIRELESS RECEIVER FOR WINDOWS)":
            case "MICROSOFT X-BOX 360 PAD":
            case "CONTROLLER (XBOX 360 FOR WINDOWS)":
            case "CONTROLLER (XBOX360 GAMEPAD)":
            case "XBOX 360 FOR WINDOWS (CONTROLLER)":
            case "MICROSOFT WIRELESS 360 CONTROLLER":

#if !UNITY_EDITOR && UNITY_ANDROID

                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                        axisName = string.Format("Joy{0} Axis 1", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 2", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                        axisName = string.Format("Joy{0} Axis 3", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 8", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        break;
                    default:
                        return 0f;
                }

#else

                switch (keyCode)
                {
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
                        axisName = string.Format("Joy{0} Axis 1", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 2", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
                        axisName = string.Format("Joy{0} Axis 4", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
                        axisName = string.Format("Joy{0} Axis 5", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_LT:
                        axisName = string.Format("Joy{0} Axis 9", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_RT:
                        axisName = string.Format("Joy{0} Axis 10", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        axisName = string.Format("Joy{0} Axis 6", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        axisName = string.Format("Joy{0} Axis 7", (int)player);
                        break;
                    default:
                        return 0f;
                }
#endif

                break;

            case "": //the driver is reporting the controller as blank
{'fraction_non_alphanumeric': 0.08984541474565108, 'fraction_numerical': 0.011313006082677927, 'mean_word_length': 1.2699850496878022, 'pattern_counts': {'":': 54, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7468010', 'n_tokens_mistral': 7986, 'n_tokens_neox': 7220, 'n_words': 1526}