public void ResetKeymap() { _selectedKeymap = null; SelectedRefLayer = null; SelectedKeymapType = null; KeymapText = string.Empty; }
public XInputConfig() { this.Name = "Default 360(XInput) Map"; this.MapType = MapType.XINPUT; this.LTrigger = (int)Xbox360Axes.LeftTrigger; this.RTrigger = (int)Xbox360Axes.RightTrigger; this.LeftRemoteX = (int)Xbox360Axes.LeftThumbX; this.LeftRemoteY = (int)Xbox360Axes.LeftThumbY; this.RightRemoteX = (int)Xbox360Axes.RightThumbX; this.RightRemoteY = (int)Xbox360Axes.RightThumbY; this.Keymap = new Dictionary <byte, int>(); Keymap.Add(4, (int)Xbox360Buttons.A); //A Keymap.Add(22, (int)Xbox360Buttons.B); //B Keymap.Add(27, (int)Xbox360Buttons.X); //x Keymap.Add(29, (int)Xbox360Buttons.Y); //y Keymap.Add(26, (int)Xbox360Buttons.LeftShoulder); //L1 Keymap.Add(20, (int)Xbox360Buttons.RightShoulder); //R1 Keymap.Add(82, (int)Xbox360Buttons.Up); //up Keymap.Add(81, (int)Xbox360Buttons.Down); //down Keymap.Add(80, (int)Xbox360Buttons.Left); //left Keymap.Add(79, (int)Xbox360Buttons.Right); //right Keymap.Add(24, (int)Xbox360Buttons.LeftThumb); //back L Keymap.Add(23, (int)Xbox360Buttons.RightThumb); //back R Keymap.Add(89, 0); //Help Keymap.Add(74, (int)Xbox360Buttons.Guide); //Home Keymap.Add(88, (int)Xbox360Buttons.Back); //back Keymap.Add(44, (int)Xbox360Buttons.Start); //start Keymap.Add(96, (int)Xbox360Buttons.LeftThumb); //LC Keymap.Add(97, (int)Xbox360Buttons.RightThumb); //RC }
public MixModeConfig() { this.Name = "Default MixMode Map"; this.MapType = MapType.MIX; this.LTrigger = (int)Xbox360Axes.LeftTrigger + 65535; this.RTrigger = (int)Xbox360Axes.RightTrigger + 65535; this.LeftRemoteX = (int)Xbox360Axes.LeftThumbX + 65535; this.LeftRemoteY = (int)Xbox360Axes.LeftThumbY + 65535; this.RightRemoteX = (int)Xbox360Axes.RightThumbX + 65535; this.RightRemoteY = (int)Xbox360Axes.RightThumbY + 65535; this.Keymap = new Dictionary <byte, int>(); Keymap.Add(4, (int)Xbox360Buttons.A + 65535); //A Keymap.Add(22, (int)Xbox360Buttons.B + 65535); //B Keymap.Add(27, (int)Xbox360Buttons.X + 65535); //x Keymap.Add(29, (int)Xbox360Buttons.Y + 65535); //y Keymap.Add(26, (int)Xbox360Buttons.LeftShoulder + 65535); //L1 Keymap.Add(20, (int)Xbox360Buttons.RightShoulder + 65535); //R1 Keymap.Add(82, (int)Xbox360Buttons.Up + 65535); //up Keymap.Add(81, (int)Xbox360Buttons.Down + 65535); //down Keymap.Add(80, (int)Xbox360Buttons.Left + 65535); //left Keymap.Add(79, (int)Xbox360Buttons.Right + 65535); //right Keymap.Add(24, (int)Xbox360Buttons.LeftThumb + 65535); //back L Keymap.Add(23, (int)Xbox360Buttons.RightThumb + 65535); //back R Keymap.Add(89, 0); //Help Keymap.Add(74, (int)Xbox360Buttons.Guide + 65535); //Home Keymap.Add(88, (int)Xbox360Buttons.Back + 65535); //back Keymap.Add(44, (int)Xbox360Buttons.Start + 65535); //start Keymap.Add(96, (int)Xbox360Buttons.LeftThumb + 65535); //LC Keymap.Add(97, (int)Xbox360Buttons.RightThumb + 65535); //RC }
private void Declare() { CronusMax = new Output.CronusPlus.Write(this); Gamepad = new Output.Gamepad(this); Gimx = new Output.Gimx.Gimx(this); GimxRemote = new Output.Gimx.GimxRemote(this); Keyboard = new Input.KeyboardHook(this); Keymap = new Keymap(this); Menu = new Menu.ShowMenu(this); Mouse = new Input.Mouse.Hook(this); Remap = new Remapping(); System = new Configuration(this); VideoResolution = new VideoResolution(this); //Fix these later KeyboardInterface = new Input.KeyboardInterface(Home); KeyboardInterface.getSystemHandle(System); KeyboardInterface.getRemapHangle(Remap); KeyboardInterface.getKeymapHandle(Keymap); TitanOne = new Output.TitanOne.Write(Home, System, Gamepad); External = new ExternalScript(Home); VideoCapture = new VideoCapture.VideoCapture(Home, System); System.GetClassHandles(VideoCapture, CronusMax, TitanOne, VideoResolution); }
private void setKeymap(Keymap keymap) { foreach (IOutputHandler handler in outputHandlers) { handler.startUpdate(); handler.reset(); handler.endUpdate(); } this.KeyMap.SetKeymap(keymap); }
public Keymap loadKeyMap(string filename) { Keymap keymap = KeymapDatabase.Current.getKeymap(filename); this.setKeymap(keymap); this.processWiimoteState(new WiimoteState()); //Sets all buttons to "not pressed" Console.WriteLine("Loaded new keymap " + filename); return(keymap); }
private static Keys MapKey(Key key) { if (Keymap.TryGetValue(key, out Keys value)) { return(value); } else { throw new NotSupportedException($"Unsupported modifier key: \"{key}\""); } }
public static string?GetKey(Key key) { if (Keymap.TryGetValue(key, out string?value)) { return(value); } else { throw new NotSupportedException($"Unsupported key: \"{key}\""); } }
private static void MapKey(StringBuilder builder, Key key) { if (Keymap.TryGetValue(key, out string?value)) { builder.Append(value); } else { throw new NotSupportedException($"Unsupported modifier key: \"{key}\""); } }
private void initialize() { this.defaultKeymap = KeymapDatabase.Current.getDefaultKeymap(); JObject specificKeymap = new JObject(); JObject commonKeymap = new JObject(); this.fallbackKeymap = defaultKeymap; this.KeyMap = new WiiKeyMap(this.WiimoteID, this.defaultKeymap, this.outputHandlers); this.KeyMap.OnButtonDown += keyMap_onButtonDown; this.KeyMap.OnButtonUp += keyMap_onButtonUp; this.KeyMap.OnConfigChanged += keyMap_onConfigChanged; this.KeyMap.OnRumble += keyMap_onRumble; this.SendConfigChangedEvt(); }
private void InitializeKeymap() { if (!File.Exists(DefaultValues.KeymapFile)) { this.UseHardcodeKeymap(); return; } try { this.keymap = JSONHelper.ParseFile <Keymap>(DefaultValues.KeymapFile); } catch (Exception ex) { logger.Error("加载keymap配置文件异常", ex); this.UseHardcodeKeymap(); } }
public WiiKeyMap(long id, Keymap keymap, List <IOutputHandler> outputHandlers) { this.id = id; this.SetKeymap(keymap); this.inputSimulator = new InputSimulator(); this.outputHandlers = outputHandlers; foreach (IOutputHandler outputHandler in outputHandlers) { if (outputHandler is IRumbleFeedback) { IRumbleFeedback rumbleFeedback = (IRumbleFeedback)outputHandler; rumbleFeedback.OnRumble += Xinput_OnRumble; } } }
void Awake() { GameObject comboObjPool = GameObject.Find("/_UIStuff/SingleComboPool"); if(comboObjPool != null) singleComboPool = comboObjPool.GetComponent<ObjectPool>(); else Debug.LogError("Cannot find Single Combo Object Pool"); keyComboContainer = transform.Find("ComboPanel").gameObject; if(keyComboContainer == null) Debug.LogError("Cannot find Score Bar Object"); keyMap = GameObject.FindGameObjectWithTag("GameManager").GetComponent<Keymap>(); if (player == 0) playerCombo = GameObject.FindWithTag("Player1").GetComponent<SpiderCombo>(); else playerCombo = GameObject.FindWithTag("Player2").GetComponent<SpiderCombo>(); }
private Action <object, RoutedEventArgs> KeymapButton_Click() { return((sender, e) => { var button = (Button)sender; var row = Grid.GetRow(button); var col = Grid.GetColumn(button); _selectedKeymap = _currentKeymapLayer.Keymaps[row, col]; // reset between key changes _selectedKeymapType = null; _selectedRefLayer = null; KeymapText = _selectedKeymap.Keypress; var selectType = _selectedKeymap.Action.Type.ToString(); SelectedKeymapType = selectType; SelectedRefLayer = _selectedKeymap.Action.ReferenceLayer; }); }
public void SetKeymap(Keymap keymap) { if (this.keymap == null || this.keymap.Equals(keymap)) { this.config = new Dictionary <string, KeymapOutConfig>(); foreach (KeymapInput input in KeymapDatabase.Current.getAvailableInputs()) { KeymapOutConfig outConfig = keymap.getConfigFor((int)id, input.Key); if (outConfig != null) { this.config.Add(input.Key, outConfig); } } KeymapOutConfig pointerConfig; if (this.config.TryGetValue("Pointer", out pointerConfig) && this.OnConfigChanged != null) { this.OnConfigChanged(new WiiKeyMapConfigChangedEvent(keymap.getName(), keymap.getFilename(), pointerConfig.Stack.First().Key)); } } }
public ScriptModeConfig() { this.Name = "Default Script Map"; this.MapType = MapType.SCRIPT; this.Keymap = new Dictionary <byte, Int32>(); Keymap.Add(4, 1948332219); //A Keymap.Add(22, 1948332219); //B Keymap.Add(27, 1948332219); //x Keymap.Add(29, 1948332219); //y Keymap.Add(26, 1948332219); //L1 Keymap.Add(20, 1948332219); //R1 Keymap.Add(82, 1948332219); //up Keymap.Add(81, 1948332219); //down Keymap.Add(80, 1948332219); //left Keymap.Add(79, 1948332219); //right Keymap.Add(24, 1948332219); //back L Keymap.Add(23, 1948332219); //back R Keymap.Add(89, 1948332219); //Help Keymap.Add(74, 1948332219); //Home Keymap.Add(88, 1948332219); //back Keymap.Add(44, 1948332219); //start Keymap.Add(96, 1948332219); //LC Keymap.Add(97, 1948332219); //RC this.LTrigger = 1948332219; this.RTrigger = 1948332219; this.LeftRemoteUp = 1948332219; this.LeftRemoteDown = 1948332219; this.LeftRemoteLeft = 1948332219; this.LeftRemoteRight = 1948332219; this.RightRemoteUp = 1948332219; this.RightRemoteDown = 1948332219; this.RightRemoteLeft = 1948332219; this.RightRemoteRight = 1948332219; }
public KeyBoardConfig() { this.Name = "Default KeyBoard Map"; this.MapType = MapType.KEYBOARD; this.Keymap = new Dictionary <byte, Int32>(); Keymap.Add(4, (int)Keys.U); //A Keymap.Add(22, (int)Keys.I); //B Keymap.Add(27, (int)Keys.O); //x Keymap.Add(29, (int)Keys.P); //y Keymap.Add(26, (int)Keys.Q); //L1 Keymap.Add(20, (int)Keys.E); //R1 Keymap.Add(82, (int)Keys.W); //up Keymap.Add(81, (int)Keys.S); //down Keymap.Add(80, (int)Keys.A); //left Keymap.Add(79, (int)Keys.D); //right Keymap.Add(24, (int)Keys.Z); //back L Keymap.Add(23, (int)Keys.C); //back R Keymap.Add(89, (int)Keys.T); //Help Keymap.Add(74, (int)Keys.Y); //Home Keymap.Add(88, (int)Keys.G); //back Keymap.Add(44, (int)Keys.H); //start Keymap.Add(96, (int)Keys.V); //LC Keymap.Add(97, (int)Keys.B); //RC this.LTrigger = (int)Keys.J; this.RTrigger = (int)Keys.L; this.LeftRemoteUp = (int)Keys.W; this.LeftRemoteDown = (int)Keys.S; this.LeftRemoteLeft = (int)Keys.A; this.LeftRemoteRight = (int)Keys.D; this.RightRemoteUp = (int)Keys.Up; this.RightRemoteDown = (int)Keys.Down; this.RightRemoteLeft = (int)Keys.Left; this.RightRemoteRight = (int)Keys.Right; }
void Update() { if (!isChangeActive) { return; } if (Input.GetKeyDown(KeyCode.Escape)) { SetKeyChangeState(false); return; } var pressedKey = GetPressedKey(); if (pressedKey != null) { keyAction.key = (KeyCode)pressedKey; buttonText.text = keyAction.key.ToString(); SetKeyChangeState(false); Keymap.Save(); } }
public void getKeymapHandle(Keymap keymap) { _keymap = keymap; }
public char toChar(Keymap km) { #region Azerty if (km == Keymap.Azerty) { if (this.PressedKey == Keys.D1) { if (this.Shift) return ('1'); else return ('&'); } else if (this.PressedKey == Keys.D2) { if (this.Shift) return ('2'); else if (this.Alt) return ('~'); else return ('é'); } else if (this.PressedKey == Keys.D3) { if (this.Shift) return ('3'); else if (this.Alt) return ('#'); else return ('"'); } else if (this.PressedKey == Keys.D4) { if (this.Shift) return ('4'); else if (this.Alt) return ('{'); else return ('\''); } else if (this.PressedKey == Keys.D5) { if (this.Shift) return ('5'); else if (this.Alt) return ('['); else return ('('); } else if (this.PressedKey == Keys.D6) { if (this.Shift) return '6'; else if (this.Alt) return ('|'); else return ('-'); } else if (this.PressedKey == Keys.D7) { if (this.Shift) return ('7'); else if (this.Alt) return ('`'); else return ('è'); } else if (this.PressedKey == Keys.D8) { if (this.Shift) return ('8'); else if (this.Alt) return ('\\'); else return ('_'); } else if (this.PressedKey == Keys.D9) { if (this.Shift) return ('9'); else if (this.Alt) return ('^'); else return ('ç'); } else if (this.PressedKey == Keys.D0) { if (this.Shift) return ('0'); else if (this.Alt) return ('@'); else return ('à'); } else if (this.PressedKey == Keys.OemPeriod) { if (this.Shift) return ('.'); else return (';'); } else if (this.PressedKey == Keys.OemComma) { if (this.Shift) return ('?'); else return (','); } else if (this.PressedKey == Keys.OemQuotes) { if (this.Shift) return '%'; else return 'ù'; } else if (this.PressedKey == Keys.OemMinus) { if (this.Shift) return ('°'); else return (')'); } else if (this.PressedKey == Keys.OemPlus) { if (this.Shift) return ('+'); else if (this.Alt) return ('}'); else return ('='); } else if (this.PressedKey == Keys.OemQuestion) { if (this.Shift) return ('/'); else return (':'); } else if (this.PressedKey == Keys.OemPipe) { if (this.Shift) return ('µ'); else return ('*'); } else if (this.PressedKey == Keys.OemOpenBrackets) { if (this.Shift) return ('°'); else if (this.Alt) return (']'); else return (')'); } else if (this.PressedKey == Keys.OemCloseBrackets) { if (this.Shift) KeyboardEventArgs.Accent = '¨'; else KeyboardEventArgs.Accent = '^'; } } #endregion #region Qwerty/US-intl else if (km == Keymap.US_int || km == Keymap.Qwerty) { if (this.PressedKey == Keys.D1) { if (this.Shift) return ('!'); else return ('1'); } else if (this.PressedKey == Keys.D2) { if (this.Shift) return ('@'); else return ('2'); } else if (this.PressedKey == Keys.D3) { if (this.Shift) return ('#'); else return ('3'); } else if (this.PressedKey == Keys.D4) { if (this.Shift) return ('$'); else return ('4'); } else if (this.PressedKey == Keys.D5) { if (this.Shift) return ('%'); else return ('5'); } else if (this.PressedKey == Keys.D6) { if (this.Shift) { if (km == Keymap.US_int) KeyboardEventArgs.Accent = '^'; else return '^'; } else return ('6'); } else if (this.PressedKey == Keys.D7) { if (this.Shift) return ('&'); else return ('7'); } else if (this.PressedKey == Keys.D8) { if (this.Shift) return ('*'); else return ('8'); } else if (this.PressedKey == Keys.D9) { if (this.Shift) return ('('); else return ('9'); } else if (this.PressedKey == Keys.D0) { if (this.Shift) return (')'); else return ('0'); } else if (this.PressedKey == Keys.OemSemicolon) { if (this.Shift) return (':'); else return (';'); } else if (this.PressedKey == Keys.OemPeriod) { if (this.Shift) return ('>'); else return ('.'); } else if (this.PressedKey == Keys.OemComma) { if (this.Shift) return ('<'); else return (','); } else if (this.PressedKey == Keys.OemQuotes) { if (this.Shift) { if (km == Keymap.US_int) KeyboardEventArgs.Accent = '"'; else return '"'; } else { if (km == Keymap.US_int) KeyboardEventArgs.Accent = '\''; else return '\''; } } else if (this.PressedKey == Keys.OemMinus) { if (this.Shift) return ('_'); else return ('-'); } else if (this.PressedKey == Keys.OemPlus) { if (this.Shift) return ('+'); else return ('='); } else if (this.PressedKey == Keys.OemQuestion) { if (this.Shift) return ('?'); else return ('/'); } else if (this.PressedKey == Keys.OemTilde) { if (this.Shift) { if (km == Keymap.US_int) KeyboardEventArgs.Accent = '~'; else return '~'; } else { if (km == Keymap.US_int) KeyboardEventArgs.Accent = '`'; else return '`'; } } else if (this.PressedKey == Keys.OemPipe) { if (this.Shift) return ('|'); else return ('\\'); } else if (this.PressedKey == Keys.OemOpenBrackets) { if (this.Shift) return ('{'); else return ('['); } else if (this.PressedKey == Keys.OemCloseBrackets) { if (this.Shift) return ('}'); else return (']'); } } #endregion #region Dvorak else if (km == Keymap.Dvorak) { throw new NotImplementedException(); } #endregion #region Bépo else if (km == Keymap.Bepo) { throw new NotImplementedException(); } #endregion if (!(this.Meta || this.Alt || this.Ctrl)) { if (this.PressedKey == Keys.Back) return '\b'; else if (this.PressedKey == Keys.Enter) return '\n'; #region Pavé numérique else if (this.PressedKey == Keys.NumPad0) return '0'; else if (this.PressedKey == Keys.NumPad1) return '1'; else if (this.PressedKey == Keys.NumPad2) return '2'; else if (this.PressedKey == Keys.NumPad3) return '3'; else if (this.PressedKey == Keys.NumPad4) return '4'; else if (this.PressedKey == Keys.NumPad5) return '5'; else if (this.PressedKey == Keys.NumPad6) return '6'; else if (this.PressedKey == Keys.NumPad7) return '7'; else if (this.PressedKey == Keys.NumPad8) return '8'; else if (this.PressedKey == Keys.NumPad9) return '9'; #endregion #region Accents else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.Space) return KeyboardEventArgs.Accent; else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.A) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) return 'À'; else return 'à'; } else if (KeyboardEventArgs.Accent == '~') { if (this.Shift) return 'Ã'; else return 'ã'; } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) return 'Á'; else return 'á'; } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) return 'Ä'; else return 'ä'; } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) return 'Â'; else return 'â'; } KeyboardEventArgs.Accent = char.MinValue; } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.N) { if (KeyboardEventArgs.Accent == '~') { if (this.Shift) return 'Ñ'; else return 'ñ'; } else { if (this.Shift) return 'N'; else return 'n'; } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.E) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) return 'È'; else return 'è'; } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) return 'É'; else return 'é'; } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) return 'Ë'; else return 'ë'; } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) return 'Ê'; else return 'ê'; } else { if (this.Shift) return 'E'; else return 'e'; } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.I) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) return 'Ì'; else return 'ì'; } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) return 'Í'; else return 'í'; } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) return 'Ï'; else return 'ï'; } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) return 'Î'; else return 'î'; } else { if (this.Shift) return 'I'; else return 'i'; } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.O) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) return 'Ò'; else return 'ò'; } else if (KeyboardEventArgs.Accent == '~') { if (this.Shift) return 'Õ'; else return 'õ'; } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) return 'Ó'; else return 'ó'; } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) return 'Ö'; else return 'ö'; } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) return 'Ô'; else return 'ô'; } KeyboardEventArgs.Accent = char.MinValue; } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.U) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) return 'Ù'; else return 'ù'; } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) return 'Ú'; else return 'ú'; } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) return 'Ü'; else return 'ü'; } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) return 'Û'; else return 'û'; } else { if (this.Shift) return 'U'; else return 'u'; } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.Y) { if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) return 'Ý'; else return 'ý'; } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) return 'Y'; else return 'ÿ'; } else { if (this.Shift) return 'Y'; else return 'y'; } } #endregion else if (this.PressedKey == Keys.Space) return ' '; else if ( this.PressedKey == Keys.A || this.PressedKey == Keys.B || this.PressedKey == Keys.C || this.PressedKey == Keys.D || this.PressedKey == Keys.E || this.PressedKey == Keys.F || this.PressedKey == Keys.G || this.PressedKey == Keys.H || this.PressedKey == Keys.I || this.PressedKey == Keys.J || this.PressedKey == Keys.K || this.PressedKey == Keys.L || this.PressedKey == Keys.M || this.PressedKey == Keys.N || this.PressedKey == Keys.O || this.PressedKey == Keys.P || this.PressedKey == Keys.Q || this.PressedKey == Keys.R || this.PressedKey == Keys.S || this.PressedKey == Keys.T || this.PressedKey == Keys.U || this.PressedKey == Keys.V || this.PressedKey == Keys.W || this.PressedKey == Keys.X || this.PressedKey == Keys.Y || this.PressedKey == Keys.Z ) { KeyboardEventArgs.Accent = char.MinValue; if (this.Shift) return this.PressedKey.ToString()[0]; else return this.PressedKey.ToString().ToLower()[0]; } } return '\0'; }
/// <summary> /// Adds a new keymap into the keymap hierarchy. /// </summary> static public Keymap addKeymap(string @nm, Keymap @parent) { return default(Keymap); }
/// <summary> /// Sets the keymap to use for binding events to /// actions. /// </summary> public void setKeymap(Keymap @map) { }
public WiiKeyMap(long id, Keymap keymap, List<IOutputHandler> outputHandlers) { this.id = id; this.SetKeymap(keymap); this.inputSimulator = new InputSimulator(); this.outputHandlers = outputHandlers; foreach (IOutputHandler outputHandler in outputHandlers) { if (outputHandler is IRumbleFeedback) { IRumbleFeedback rumbleFeedback = (IRumbleFeedback)outputHandler; rumbleFeedback.OnRumble += Xinput_OnRumble; } } }
public void SetKeymap(Keymap keymap) { if (this.keymap == null || this.keymap.Equals(keymap)) { this.config = new Dictionary<string, KeymapOutConfig>(); foreach (KeymapInput input in KeymapDatabase.Current.getAvailableInputs()) { KeymapOutConfig outConfig = keymap.getConfigFor((int)id, input.Key); if (outConfig != null) { this.config.Add(input.Key, outConfig); } } KeymapOutConfig pointerConfig; if (this.config.TryGetValue("Pointer", out pointerConfig) && this.OnConfigChanged != null) { this.OnConfigChanged(new WiiKeyMapConfigChangedEvent(keymap.getName(),keymap.getFilename(),pointerConfig.Stack.First().Key)); } } }
/// <summary> /// Adds a new keymap into the keymap hierarchy. /// </summary> static public Keymap addKeymap(string @nm, Keymap @parent) { return(default(Keymap)); }
public char toChar(Keymap km) { #region Azerty if (km == Keymap.Azerty) { if (this.PressedKey == Keys.D1) { if (this.Shift) { return('1'); } else { return('&'); } } else if (this.PressedKey == Keys.D2) { if (this.Shift) { return('2'); } else if (this.Alt) { return('~'); } else { return('é'); } } else if (this.PressedKey == Keys.D3) { if (this.Shift) { return('3'); } else if (this.Alt) { return('#'); } else { return('"'); } } else if (this.PressedKey == Keys.D4) { if (this.Shift) { return('4'); } else if (this.Alt) { return('{'); } else { return('\''); } } else if (this.PressedKey == Keys.D5) { if (this.Shift) { return('5'); } else if (this.Alt) { return('['); } else { return('('); } } else if (this.PressedKey == Keys.D6) { if (this.Shift) { return('6'); } else if (this.Alt) { return('|'); } else { return('-'); } } else if (this.PressedKey == Keys.D7) { if (this.Shift) { return('7'); } else if (this.Alt) { return('`'); } else { return('è'); } } else if (this.PressedKey == Keys.D8) { if (this.Shift) { return('8'); } else if (this.Alt) { return('\\'); } else { return('_'); } } else if (this.PressedKey == Keys.D9) { if (this.Shift) { return('9'); } else if (this.Alt) { return('^'); } else { return('ç'); } } else if (this.PressedKey == Keys.D0) { if (this.Shift) { return('0'); } else if (this.Alt) { return('@'); } else { return('à'); } } else if (this.PressedKey == Keys.OemPeriod) { if (this.Shift) { return('.'); } else { return(';'); } } else if (this.PressedKey == Keys.OemComma) { if (this.Shift) { return('?'); } else { return(','); } } else if (this.PressedKey == Keys.OemQuotes) { if (this.Shift) { return('%'); } else { return('ù'); } } else if (this.PressedKey == Keys.OemMinus) { if (this.Shift) { return('°'); } else { return(')'); } } else if (this.PressedKey == Keys.OemPlus) { if (this.Shift) { return('+'); } else if (this.Alt) { return('}'); } else { return('='); } } else if (this.PressedKey == Keys.OemQuestion) { if (this.Shift) { return('/'); } else { return(':'); } } else if (this.PressedKey == Keys.OemPipe) { if (this.Shift) { return('µ'); } else { return('*'); } } else if (this.PressedKey == Keys.OemOpenBrackets) { if (this.Shift) { return('°'); } else if (this.Alt) { return(']'); } else { return(')'); } } else if (this.PressedKey == Keys.OemCloseBrackets) { if (this.Shift) { KeyboardEventArgs.Accent = '¨'; } else { KeyboardEventArgs.Accent = '^'; } } } #endregion #region Qwerty/US-intl else if (km == Keymap.US_int || km == Keymap.Qwerty) { if (this.PressedKey == Keys.D1) { if (this.Shift) { return('!'); } else { return('1'); } } else if (this.PressedKey == Keys.D2) { if (this.Shift) { return('@'); } else { return('2'); } } else if (this.PressedKey == Keys.D3) { if (this.Shift) { return('#'); } else { return('3'); } } else if (this.PressedKey == Keys.D4) { if (this.Shift) { return('$'); } else { return('4'); } } else if (this.PressedKey == Keys.D5) { if (this.Shift) { return('%'); } else { return('5'); } } else if (this.PressedKey == Keys.D6) { if (this.Shift) { if (km == Keymap.US_int) { KeyboardEventArgs.Accent = '^'; } else { return('^'); } } else { return('6'); } } else if (this.PressedKey == Keys.D7) { if (this.Shift) { return('&'); } else { return('7'); } } else if (this.PressedKey == Keys.D8) { if (this.Shift) { return('*'); } else { return('8'); } } else if (this.PressedKey == Keys.D9) { if (this.Shift) { return('('); } else { return('9'); } } else if (this.PressedKey == Keys.D0) { if (this.Shift) { return(')'); } else { return('0'); } } else if (this.PressedKey == Keys.OemSemicolon) { if (this.Shift) { return(':'); } else { return(';'); } } else if (this.PressedKey == Keys.OemPeriod) { if (this.Shift) { return('>'); } else { return('.'); } } else if (this.PressedKey == Keys.OemComma) { if (this.Shift) { return('<'); } else { return(','); } } else if (this.PressedKey == Keys.OemQuotes) { if (this.Shift) { if (km == Keymap.US_int) { KeyboardEventArgs.Accent = '"'; } else { return('"'); } } else { if (km == Keymap.US_int) { KeyboardEventArgs.Accent = '\''; } else { return('\''); } } } else if (this.PressedKey == Keys.OemMinus) { if (this.Shift) { return('_'); } else { return('-'); } } else if (this.PressedKey == Keys.OemPlus) { if (this.Shift) { return('+'); } else { return('='); } } else if (this.PressedKey == Keys.OemQuestion) { if (this.Shift) { return('?'); } else { return('/'); } } else if (this.PressedKey == Keys.OemTilde) { if (this.Shift) { if (km == Keymap.US_int) { KeyboardEventArgs.Accent = '~'; } else { return('~'); } } else { if (km == Keymap.US_int) { KeyboardEventArgs.Accent = '`'; } else { return('`'); } } } else if (this.PressedKey == Keys.OemPipe) { if (this.Shift) { return('|'); } else { return('\\'); } } else if (this.PressedKey == Keys.OemOpenBrackets) { if (this.Shift) { return('{'); } else { return('['); } } else if (this.PressedKey == Keys.OemCloseBrackets) { if (this.Shift) { return('}'); } else { return(']'); } } } #endregion #region Dvorak else if (km == Keymap.Dvorak) { throw new NotImplementedException(); } #endregion #region Bépo else if (km == Keymap.Bepo) { throw new NotImplementedException(); } #endregion if (!(this.Meta || this.Alt || this.Ctrl)) { if (this.PressedKey == Keys.Back) { return('\b'); } else if (this.PressedKey == Keys.Enter) { return('\n'); } #region Pavé numérique else if (this.PressedKey == Keys.NumPad0) { return('0'); } else if (this.PressedKey == Keys.NumPad1) { return('1'); } else if (this.PressedKey == Keys.NumPad2) { return('2'); } else if (this.PressedKey == Keys.NumPad3) { return('3'); } else if (this.PressedKey == Keys.NumPad4) { return('4'); } else if (this.PressedKey == Keys.NumPad5) { return('5'); } else if (this.PressedKey == Keys.NumPad6) { return('6'); } else if (this.PressedKey == Keys.NumPad7) { return('7'); } else if (this.PressedKey == Keys.NumPad8) { return('8'); } else if (this.PressedKey == Keys.NumPad9) { return('9'); } #endregion #region Accents else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.Space) { return(KeyboardEventArgs.Accent); } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.A) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) { return('À'); } else { return('à'); } } else if (KeyboardEventArgs.Accent == '~') { if (this.Shift) { return('Ã'); } else { return('ã'); } } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) { return('Á'); } else { return('á'); } } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) { return('Ä'); } else { return('ä'); } } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) { return('Â'); } else { return('â'); } } KeyboardEventArgs.Accent = char.MinValue; } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.N) { if (KeyboardEventArgs.Accent == '~') { if (this.Shift) { return('Ñ'); } else { return('ñ'); } } else { if (this.Shift) { return('N'); } else { return('n'); } } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.E) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) { return('È'); } else { return('è'); } } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) { return('É'); } else { return('é'); } } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) { return('Ë'); } else { return('ë'); } } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) { return('Ê'); } else { return('ê'); } } else { if (this.Shift) { return('E'); } else { return('e'); } } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.I) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) { return('Ì'); } else { return('ì'); } } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) { return('Í'); } else { return('í'); } } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) { return('Ï'); } else { return('ï'); } } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) { return('Î'); } else { return('î'); } } else { if (this.Shift) { return('I'); } else { return('i'); } } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.O) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) { return('Ò'); } else { return('ò'); } } else if (KeyboardEventArgs.Accent == '~') { if (this.Shift) { return('Õ'); } else { return('õ'); } } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) { return('Ó'); } else { return('ó'); } } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) { return('Ö'); } else { return('ö'); } } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) { return('Ô'); } else { return('ô'); } } KeyboardEventArgs.Accent = char.MinValue; } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.U) { if (KeyboardEventArgs.Accent == '`') { if (this.Shift) { return('Ù'); } else { return('ù'); } } else if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) { return('Ú'); } else { return('ú'); } } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) { return('Ü'); } else { return('ü'); } } else if (KeyboardEventArgs.Accent == '^') { if (this.Shift) { return('Û'); } else { return('û'); } } else { if (this.Shift) { return('U'); } else { return('u'); } } } else if (KeyboardEventArgs.Accent != char.MinValue && this.PressedKey == Keys.Y) { if (KeyboardEventArgs.Accent == '\'') { if (this.Shift) { return('Ý'); } else { return('ý'); } } else if (KeyboardEventArgs.Accent == '"') { if (this.Shift) { return('Y'); } else { return('ÿ'); } } else { if (this.Shift) { return('Y'); } else { return('y'); } } } #endregion else if (this.PressedKey == Keys.Space) { return(' '); } else if ( this.PressedKey == Keys.A || this.PressedKey == Keys.B || this.PressedKey == Keys.C || this.PressedKey == Keys.D || this.PressedKey == Keys.E || this.PressedKey == Keys.F || this.PressedKey == Keys.G || this.PressedKey == Keys.H || this.PressedKey == Keys.I || this.PressedKey == Keys.J || this.PressedKey == Keys.K || this.PressedKey == Keys.L || this.PressedKey == Keys.M || this.PressedKey == Keys.N || this.PressedKey == Keys.O || this.PressedKey == Keys.P || this.PressedKey == Keys.Q || this.PressedKey == Keys.R || this.PressedKey == Keys.S || this.PressedKey == Keys.T || this.PressedKey == Keys.U || this.PressedKey == Keys.V || this.PressedKey == Keys.W || this.PressedKey == Keys.X || this.PressedKey == Keys.Y || this.PressedKey == Keys.Z ) { KeyboardEventArgs.Accent = char.MinValue; if (this.Shift) { return(this.PressedKey.ToString()[0]); } else { return(this.PressedKey.ToString().ToLower()[0]); } } } return('\0'); }
public void SetFallbackKeymap(string filename) { this.fallbackKeymap = this.loadKeyMap(filename); }