All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.joaocosta.minart.backend.JsKeyMapping.scala Maven / Gradle / Ivy

There is a newer version: 0.6.2
Show newest version
package eu.joaocosta.minart.backend

import eu.joaocosta.minart.input.KeyboardInput._

/** Key mappings for the JavaScript backend.
  */
object JsKeyMapping extends KeyMapping[Int] {
  protected final val mappings: Map[Int, Key] = Map(
    65  -> Key.A,
    66  -> Key.B,
    67  -> Key.C,
    68  -> Key.D,
    69  -> Key.E,
    70  -> Key.F,
    71  -> Key.G,
    72  -> Key.H,
    73  -> Key.I,
    74  -> Key.J,
    75  -> Key.K,
    76  -> Key.L,
    77  -> Key.M,
    78  -> Key.N,
    79  -> Key.O,
    80  -> Key.P,
    81  -> Key.Q,
    82  -> Key.R,
    83  -> Key.S,
    84  -> Key.T,
    85  -> Key.U,
    86  -> Key.V,
    87  -> Key.W,
    88  -> Key.X,
    89  -> Key.Y,
    90  -> Key.Z,
    48  -> Key.Digit0,
    49  -> Key.Digit1,
    50  -> Key.Digit2,
    51  -> Key.Digit3,
    52  -> Key.Digit4,
    53  -> Key.Digit5,
    54  -> Key.Digit6,
    55  -> Key.Digit7,
    56  -> Key.Digit8,
    57  -> Key.Digit9,
    96  -> Key.NumPad0,
    97  -> Key.NumPad1,
    98  -> Key.NumPad2,
    99  -> Key.NumPad3,
    100 -> Key.NumPad4,
    101 -> Key.NumPad5,
    102 -> Key.NumPad6,
    103 -> Key.NumPad7,
    104 -> Key.NumPad8,
    105 -> Key.NumPad9,
    32  -> Key.Space,
    9   -> Key.Tab,
    13  -> Key.Enter,
    8   -> Key.Backspace,
    27  -> Key.Escape,
    16  -> Key.Shift,
    17  -> Key.Ctrl,
    18  -> Key.Alt,
    224 -> Key.Meta,
    38  -> Key.Up,
    40  -> Key.Down,
    37  -> Key.Left,
    39  -> Key.Right
  )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy