internal KeyboardDescription(IKeyboardSwitchingAdaptor engine, KeyboardType type) { Engine = engine; Type = type; IsAvailable = true; OperatingSystem = Environment.OSVersion.Platform; }
/// <summary> /// Initializes a new instance of the /// <see cref="T:Palaso.UI.WindowsForms.Keyboard.KeyboardDescription"/> class. /// </summary> internal KeyboardDescription(string name, string layout, string locale, IInputLanguage language, IKeyboardSwitchingAdaptor engine, KeyboardType type = KeyboardType.System) { InternalName = name; Layout = layout; Locale = locale; Engine = engine; Type = type; IsAvailable = true; OperatingSystem = Environment.OSVersion.Platform; InputLanguage = language; }
public LargeButtonKeyboard() : base() { InitializeComponent(); keyboardType = KeyboardType.Lowercase; string[,] characters = { { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ABC", "z", "x", "c", "v", "b", "n", "m", backspace, space, deleteWord, clear}, { "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "A", "S", "D", "F", "G", "H", "J", "K", "L", "123", "Z", "X", "C", "V", "B", "N", "M", backspace, space, deleteWord, clear}, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "$", "%", "^", "&", "*", "_", "abc", "\"", ",", ".", "?", ":", ";", "'", backspace, space, deleteWord, clear} }; keyboard = new ALSKey[characters.GetLength(0), characters.GetLength(1)]; for (int i = 0; i < keyboard.GetLength(0); i++) { for (int j = 0; j < keyboard.GetLength(1); j++) { keyboard[i, j] = new ALSKey(); Controls.Add(keyboard[i, j]); keyboard[i, j].Text = characters[i, j]; keyboard[i, j].btnType = ALSButton.ButtonType.key; switch (keyboard[i, j].Text) { case backspace: keyboard[i, j].Click += Backspace; break; case deleteWord: keyboard[i, j].Click += DeleteWord; break; case clear: keyboard[i, j].Click += Clear; break; case "abc": case "ABC": case "123": keyboard[i, j].Click += NavigateKeyboard; break; default: keyboard[i, j].Click += TypeCharacter; break; } } } }
public KeyboardErrorDescription(KeyboardType type, object details) { Type = type; Details = details; }
private void NavigateKeyboard(object sender, EventArgs e) { ALSButton button = (ALSButton)sender; switch (button.Text) { case "abc": keyboardType = KeyboardType.Lowercase; break; case "ABC": keyboardType = KeyboardType.Uppercase; break; case "123": keyboardType = KeyboardType.Characters; break; case lLetters1: keyboardType = KeyboardType.aTOi; break; case lLetters2: keyboardType = KeyboardType.jTOr; break; case lLetters3: keyboardType = KeyboardType.sTOz; break; case uLetters1: keyboardType = KeyboardType.ATOI; break; case uLetters2: keyboardType = KeyboardType.JTOR; break; case uLetters3: keyboardType = KeyboardType.STOZ; break; case "1-9": keyboardType = KeyboardType._1TO9; break; case symbols1: keyboardType = KeyboardType.Punctuation; break; case symbols2: keyboardType = KeyboardType.Symbols; break; case symbols3: keyboardType = KeyboardType.Symbols2; break; case "Back": switch (keyboardType) { case KeyboardType.aTOi: case KeyboardType.jTOr: case KeyboardType.sTOz: keyboardType = KeyboardType.Lowercase; break; case KeyboardType.ATOI: case KeyboardType.JTOR: case KeyboardType.STOZ: keyboardType = KeyboardType.Uppercase; break; case KeyboardType._1TO9: case KeyboardType.Punctuation: case KeyboardType.Symbols: case KeyboardType.Symbols2: keyboardType = KeyboardType.Characters; break; } break; default: if (button.Text.Length > 0) { if (button.Text[0] >= 'a' && button.Text[0] <= 'z') keyboardType = KeyboardType.Lowercase; else if (button.Text[0] >= 'A' && button.Text[0] <= 'Z') { keyboardType = KeyboardType.Uppercase; } else { keyboardType = KeyboardType.Characters; } } break; } int temp = (int)keyboardType; for (int i = 0; i < keyboard.GetLength(1); i++) keyboard[(int)keyboardType, i].BringToFront(); }
private void initialConfiguration() { InitializeComponent(); keyboardType = KeyboardType.Lowercase; string[,] letters = { { lLetters1, lLetters2, lLetters3, "?", ".", "ABC", "Space", "Backspace", "Delete Word", "Clear"}, { uLetters1, uLetters2, uLetters3, "?", ".", "123", "Space", "Backspace", "Delete Word", "Clear"}, { "0", "1-9", symbols1, symbols2, symbols3, "abc", "Space", "Backspace", "Delete Word", "Clear"}, { "a", "b", "c", "d", "e", "f", "g", "h", "i", "Back"}, { "j", "k", "l", "m", "n", "o", "p", "q", "r", "Back"}, { "s", "t", "u", "v", "w", "x", "y", "z", "", "Back"}, { "A", "B", "C", "D", "E", "F", "G", "H", "I", "Back"}, { "J", "K", "L", "M", "N", "O", "P", "Q", "R", "Back"}, { "S", "T", "U", "V", "W", "X", "Y", "Z", "", "Back"}, { "1", "2", "3", "4", "5", "6", "7", "8", "9", "Back"}, { ".", "!", "?", ",", ":", ";", "'", "\"", "", "Back"}, { "@", "$", "%", "^", "&&", "*", "+", "-", "=", "Back"}, { "(", ")", "[", "]", "{", "}", "|", "\\", "/", "Back"} }; keyboard = new ALSKey[letters.GetLength(0), letters.GetLength(1)]; for (int i = 0; i < keyboard.GetLength(0); i++) { for (int j = 0; j < keyboard.GetLength(1); j++) { keyboard[i, j] = new ALSKey(); Controls.Add(keyboard[i, j]); keyboard[i, j].Text = letters[i, j]; keyboard[i, j].btnType = ALSButton.ButtonType.key; switch (i) { case 0: case 1: if (j < 3 || j == 5) keyboard[i, j].Click += NavigateKeyboard; else if (j == 3 || j == 4 || j == 6) keyboard[i, j].Click += TypeCharacter; else if (j == 7) keyboard[i, j].Click += Backspace; else if (j == 8) { if (!browserMode) keyboard[i, j].Click += DeleteWord; else { keyboard[i, j].Enabled = false; keyboard[i, j].Visible = false; } } else if (j == 9) { if (!browserMode) keyboard[i, j].Click += Clear; else { //keyboard[i, j].Location = keyboard[1, 8].Location; //move clear to delete words position } } break; case 2: if (j == 0) keyboard[i, j].Click += TypeCharacter; else if (j >= 1 && j <= 5) keyboard[i, j].Click += NavigateKeyboard; else if (j == 6) keyboard[i, j].Click += TypeCharacter; else if (j == 7) keyboard[i, j].Click += Backspace; else if (j == 8) { if (!browserMode) keyboard[i, j].Click += DeleteWord; else { keyboard[i, j].Enabled = false; keyboard[i, j].Visible = false; } } else if (j == 9) keyboard[i, j].Click += Clear; break; default: if (j < 9) { keyboard[i, j].Click += TypeCharacter; keyboard[i, j].Click += NavigateKeyboard; } else keyboard[i, j].Click += NavigateKeyboard; break; } } } SetIsBrowser(browserMode); }
private void NavigateKeyboard(object sender, EventArgs e) { ALSButton button = (ALSButton)sender; switch (button.Text) { case "abc": keyboardType = KeyboardType.Lowercase; break; case "ABC": keyboardType = KeyboardType.Uppercase; break; case "123": keyboardType = KeyboardType.Characters; break; } int temp = (int)keyboardType; for (int i = 0; i < keyboard.GetLength(1); i++) keyboard[(int)keyboardType, i].BringToFront(); }
internal static MusicPlayer Create(RawMusicSheet rawMusicSheet, KeyboardType type) { return(MusicBoxNotationMusicPlayerFactory(rawMusicSheet, type)); }
private static MusicPlayer MusicBoxNotationMusicPlayerFactory(RawMusicSheet rawMusicSheet, KeyboardType type) { var musicSheet = new MusicSheetParser(new ChordParser(new NoteParser(), rawMusicSheet.Instrument)).Parse( rawMusicSheet.Melody, int.Parse(rawMusicSheet.Tempo), int.Parse(rawMusicSheet.Meter.Split('/')[0]), int.Parse(rawMusicSheet.Meter.Split('/')[1])); var algorithm = rawMusicSheet.Algorithm == "favor notes" ? new FavorNotesAlgorithm() : (IPlayAlgorithm) new FavorChordsAlgorithm(); return(new MusicPlayer( musicSheet, GetInstrument(rawMusicSheet.Instrument, type), algorithm)); }
public MyKeyboard(Grid KeyboardHolderGrid, ICommand OnOK, ICommand OnChange) { this.KeyboardType = typeof(PropertyType).Equals(typeof(int)) ? KeyboardType.Int : typeof(PropertyType).Equals(typeof(decimal)) ? KeyboardType.Decimal : KeyboardType.Default; this.KeyboardHolderGrid = KeyboardHolderGrid; this.OnOK = OnOK; this.OnChange = OnChange; Button_1 = new KeyboardButton() { Value = "1", Label = new Label() { Text = "۱", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_2 = new KeyboardButton() { Value = "2", Label = new Label() { Text = "۲", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_3 = new KeyboardButton() { Value = "3", Label = new Label() { Text = "۳", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_4 = new KeyboardButton() { Value = "4", Label = new Label() { Text = "۴", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_5 = new KeyboardButton() { Value = "5", Label = new Label() { Text = "۵", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_6 = new KeyboardButton() { Value = "6", Label = new Label() { Text = "۶", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_7 = new KeyboardButton() { Value = "7", Label = new Label() { Text = "۷", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_8 = new KeyboardButton() { Value = "8", Label = new Label() { Text = "۸", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_9 = new KeyboardButton() { Value = "9", Label = new Label() { Text = "۹", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_0 = new KeyboardButton() { Value = "0", Label = new Label() { Text = "۰", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_Dot = new KeyboardButton() { Value = ".", Label = new Label() { Text = "/", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; Button_Clear = new KeyboardButton() { Value = "Clear", Image = new Image() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, Source = "BackSpace.png" } }; Button_OK = new KeyboardButton() { Value = "OK", Image = new Image() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, Source = "OK_B.png" } }; Button_Temp1 = new KeyboardButton() { Value = "", Label = new Label() { Text = "", VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, FontAttributes = FontAttributes.Bold } }; if (KeyboardType == KeyboardType.Int) { Labels_Landscape = new KeyboardButton[1][]; Labels_Landscape[0] = new KeyboardButton[12] { Button_1, Button_2, Button_3, Button_4, Button_5, Button_6, Button_7, Button_8, Button_9, Button_0, Button_Clear, Button_OK }; Labels_Portrait = new KeyboardButton[2][]; Labels_Portrait[0] = new KeyboardButton[6] { Button_1, Button_2, Button_3, Button_4, Button_5, Button_Clear }; Labels_Portrait[1] = new KeyboardButton[6] { Button_6, Button_7, Button_8, Button_9, Button_0, Button_OK }; } else if (KeyboardType == KeyboardType.Decimal) { Labels_Landscape = new KeyboardButton[1][]; Labels_Landscape[0] = new KeyboardButton[13] { Button_1, Button_2, Button_3, Button_4, Button_5, Button_6, Button_7, Button_8, Button_9, Button_0, Button_Dot, Button_Clear, Button_OK }; Labels_Portrait = new KeyboardButton[2][]; Labels_Portrait[0] = new KeyboardButton[7] { Button_1, Button_2, Button_3, Button_4, Button_5, Button_Temp1, Button_Clear }; Labels_Portrait[1] = new KeyboardButton[7] { Button_6, Button_7, Button_8, Button_9, Button_0, Button_Dot, Button_OK }; } var AllButtons = new List <KeyboardButton>() { Button_1, Button_2, Button_3, Button_4, Button_5, Button_6, Button_7, Button_8, Button_9, Button_0, Button_Dot, Button_Clear, Button_OK, Button_Temp1 }; foreach (var button in AllButtons) { var TapGestureRecognizer = new TapGestureRecognizer(); TapGestureRecognizer.Tapped += (s, e) => { var Value = button.Value; KeyboardClicked(Value); }; if (button.Label != null) { button.Label.GestureRecognizers.Add(TapGestureRecognizer); } else { button.Image.GestureRecognizers.Add(TapGestureRecognizer); } } }
public void ShowKeyboard(KeyboardTextInput textInput, string initialValue, int maxCharacters, KeyboardType keyboardType) { currentType = keyboardType; GetInputText().text = initialValue; showingSymbols = false; maxInputLength = maxCharacters; keyboardTextInput = textInput; if (emailKeyboard != null) { emailKeyboard.SetActive(false); } if (numPadKeyboard != null) { numPadKeyboard.SetActive(false); } switch (keyboardType) { case KeyboardType.EMAIL: emailKeyboard.SetActive(true); break; case KeyboardType.NUMBER: numPadKeyboard.SetActive(true); break; } }
protected override void UpdateDetailDisplay(View cell) { if (cell == null) { return; } TextView label; EditText _entry; DroidResources.DecodeStringEntryLayout(Context, cell, out label, out _entry); if (_entry == null) { return; } if (_entry.Text != Value) { _entry.Text = Value; } if (_entry.Hint != Hint) { _entry.Hint = Hint; } var inputType = KeyboardType.InputTypesFromUIKeyboardType(); if (Password) { inputType |= InputTypes.TextVariationPassword; } if (IsEmail) { inputType |= AndroidDialogEnumHelper.KeyboardTypeMap[UIKeyboardType.EmailAddress]; } if (Numeric) { inputType |= AndroidDialogEnumHelper.KeyboardTypeMap[UIKeyboardType.DecimalPad]; } if (NoAutoCorrect) { inputType |= AndroidDialogEnumHelper.KeyboardTypeMap[UIKeyboardType.NoAutoCorrect]; } if (Lines > 1) { inputType |= InputTypes.TextFlagMultiLine; if (_entry.LineCount != Lines) { _entry.SetLines(Lines); } } else if (Send != null) { if (_entry.ImeOptions != ImeAction.Go) { _entry.ImeOptions = ImeAction.Go; _entry.SetImeActionLabel("Go", ImeAction.Go); } } else { var imeOptions = ReturnKeyType.ImeActionFromUIReturnKeyType(); if (_entry.ImeOptions != imeOptions) { _entry.ImeOptions = imeOptions; } } if (_entry.InputType != inputType) { _entry.InputType = inputType; } //android can't seem to find the correct NextFocusDown if items are added dynamically, we'll catch the next/previous ourselves _entry.EditorAction += (sender, args) => { if (args.ActionId == ImeAction.Next || (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Honeycomb && args.ActionId == ImeAction.Previous)) { ViewGroup group = _entry.Parent as ViewGroup; IViewParent currentLoop = _entry.Parent; while (currentLoop != null) { currentLoop = currentLoop.Parent; if (currentLoop is ViewGroup) { group = (ViewGroup)currentLoop; } } var focus = FocusFinder.Instance.FindNextFocus(group, _entry, args.ActionId == ImeAction.Next ? FocusSearchDirection.Down : FocusSearchDirection.Up); if (focus != null) { focus.RequestFocus(); focus.RequestFocusFromTouch(); } } }; }
/// <summary> /// Displays a native platform prompt, allowing the application user to enter a string. /// </summary> /// <param name="title">Title to display</param> /// <param name="message">Message to display</param> /// <param name="accept">Text for the accept button</param> /// <param name="cancel">Text for the cancel button</param> /// <param name="placeholder">Placeholder text to display in the prompt</param> /// <param name="maxLength">Maximum length of the user response</param> /// <param name="keyboardType">Keyboard type to use for the user response</param> /// <param name="initialValue">Pre-defined response that will be displayed, and which can be edited</param> /// <returns><c>string</c> entered by the user. <c>null</c> if cancel is pressed</returns> public virtual Task <string> DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string placeholder = default, int maxLength = -1, KeyboardType keyboardType = KeyboardType.Default, string initialValue = "") { var keyboard = _keyboardMapper.Map(keyboardType); return(_applicationProvider.MainPage.DisplayPromptAsync(title, message, accept, cancel, placeholder, maxLength, keyboard, initialValue)); }
public KeyboardTranslationSDL(KeyboardType keyboardType) { dxKeys = new List <DxKeys>(); dxKeys.Add(new DxKeys { SDLK = 0, DxUK = "SDLK_UNKNOWN" }); dxKeys.Add(new DxKeys { SDLK = 8, DxUK = "Backspace" }); dxKeys.Add(new DxKeys { SDLK = 9, DxUK = "Tab" }); dxKeys.Add(new DxKeys { SDLK = 12, DxUK = "SDLK_CLEAR" }); dxKeys.Add(new DxKeys { SDLK = 13, DxUK = "Return" }); dxKeys.Add(new DxKeys { SDLK = 19, DxUK = "Pause" }); dxKeys.Add(new DxKeys { SDLK = 27, DxUK = "Escape" }); dxKeys.Add(new DxKeys { SDLK = 32, DxUK = "Space" }); dxKeys.Add(new DxKeys { SDLK = 33, DxUK = "SDLK_EXCLAIM" }); dxKeys.Add(new DxKeys { SDLK = 34, DxUK = "SDLK_QUOTEDBL" }); dxKeys.Add(new DxKeys { SDLK = 35, DxUK = "SDLK_HASH" }); dxKeys.Add(new DxKeys { SDLK = 36, DxUK = "SDLK_DOLLAR" }); dxKeys.Add(new DxKeys { SDLK = 38, DxUK = "SDLK_AMPERSAND" }); dxKeys.Add(new DxKeys { SDLK = 39, DxUK = "Apostrophe" }); dxKeys.Add(new DxKeys { SDLK = 40, DxUK = "SDLK_LEFTPAREN" }); dxKeys.Add(new DxKeys { SDLK = 41, DxUK = "SDLK_RIGHTPAREN" }); dxKeys.Add(new DxKeys { SDLK = 42, DxUK = "SDLK_ASTERISK" }); dxKeys.Add(new DxKeys { SDLK = 43, DxUK = "SDLK_PLUS" }); dxKeys.Add(new DxKeys { SDLK = 44, DxUK = "Comma" }); dxKeys.Add(new DxKeys { SDLK = 45, DxUK = "Minus" }); dxKeys.Add(new DxKeys { SDLK = 46, DxUK = "Period" }); dxKeys.Add(new DxKeys { SDLK = 47, DxUK = "Slash" }); dxKeys.Add(new DxKeys { SDLK = 48, DxUK = "D0" }); dxKeys.Add(new DxKeys { SDLK = 49, DxUK = "D1" }); dxKeys.Add(new DxKeys { SDLK = 50, DxUK = "D2" }); dxKeys.Add(new DxKeys { SDLK = 51, DxUK = "D3" }); dxKeys.Add(new DxKeys { SDLK = 52, DxUK = "D4" }); dxKeys.Add(new DxKeys { SDLK = 53, DxUK = "D5" }); dxKeys.Add(new DxKeys { SDLK = 54, DxUK = "D6" }); dxKeys.Add(new DxKeys { SDLK = 55, DxUK = "D7" }); dxKeys.Add(new DxKeys { SDLK = 56, DxUK = "D8" }); dxKeys.Add(new DxKeys { SDLK = 57, DxUK = "D9" }); dxKeys.Add(new DxKeys { SDLK = 58, DxUK = "Colon" }); dxKeys.Add(new DxKeys { SDLK = 59, DxUK = "Semicolon" }); dxKeys.Add(new DxKeys { SDLK = 60, DxUK = "Oem102" }); dxKeys.Add(new DxKeys { SDLK = 61, DxUK = "Equals" }); dxKeys.Add(new DxKeys { SDLK = 62, DxUK = "SDLK_GREATER" }); dxKeys.Add(new DxKeys { SDLK = 63, DxUK = "SDLK_QUESTION" }); dxKeys.Add(new DxKeys { SDLK = 64, DxUK = "SDLK_AT" }); // skip uppercase dxKeys.Add(new DxKeys { SDLK = 91, DxUK = "LeftBracket" }); dxKeys.Add(new DxKeys { SDLK = 92, DxUK = "Backslash" }); dxKeys.Add(new DxKeys { SDLK = 93, DxUK = "RightBracket" }); dxKeys.Add(new DxKeys { SDLK = 94, DxUK = "SDLK_CARET" }); dxKeys.Add(new DxKeys { SDLK = 95, DxUK = "SDLK_UNDERSCORE" }); dxKeys.Add(new DxKeys { SDLK = 96, DxUK = "Grave" }); dxKeys.Add(new DxKeys { SDLK = 97, DxUK = "A" }); dxKeys.Add(new DxKeys { SDLK = 98, DxUK = "B" }); dxKeys.Add(new DxKeys { SDLK = 99, DxUK = "C" }); dxKeys.Add(new DxKeys { SDLK = 100, DxUK = "D" }); dxKeys.Add(new DxKeys { SDLK = 101, DxUK = "E" }); dxKeys.Add(new DxKeys { SDLK = 102, DxUK = "F" }); dxKeys.Add(new DxKeys { SDLK = 103, DxUK = "G" }); dxKeys.Add(new DxKeys { SDLK = 104, DxUK = "H" }); dxKeys.Add(new DxKeys { SDLK = 105, DxUK = "I" }); dxKeys.Add(new DxKeys { SDLK = 106, DxUK = "J" }); dxKeys.Add(new DxKeys { SDLK = 107, DxUK = "K" }); dxKeys.Add(new DxKeys { SDLK = 108, DxUK = "L" }); dxKeys.Add(new DxKeys { SDLK = 109, DxUK = "M" }); dxKeys.Add(new DxKeys { SDLK = 110, DxUK = "N" }); dxKeys.Add(new DxKeys { SDLK = 111, DxUK = "O" }); dxKeys.Add(new DxKeys { SDLK = 112, DxUK = "P" }); dxKeys.Add(new DxKeys { SDLK = 113, DxUK = "Q" }); dxKeys.Add(new DxKeys { SDLK = 114, DxUK = "R" }); dxKeys.Add(new DxKeys { SDLK = 115, DxUK = "S" }); dxKeys.Add(new DxKeys { SDLK = 116, DxUK = "T" }); dxKeys.Add(new DxKeys { SDLK = 117, DxUK = "U" }); dxKeys.Add(new DxKeys { SDLK = 118, DxUK = "V" }); dxKeys.Add(new DxKeys { SDLK = 119, DxUK = "W" }); dxKeys.Add(new DxKeys { SDLK = 120, DxUK = "X" }); dxKeys.Add(new DxKeys { SDLK = 121, DxUK = "Y" }); dxKeys.Add(new DxKeys { SDLK = 122, DxUK = "Z" }); dxKeys.Add(new DxKeys { SDLK = 127, DxUK = "Delete" }); // end ascii mapped keysims // SDLK_WORLD dxKeys.Add(new DxKeys { SDLK = 160, DxUK = "SDLK_WORLD_0" }); dxKeys.Add(new DxKeys { SDLK = 161, DxUK = "SDLK_WORLD_1" }); dxKeys.Add(new DxKeys { SDLK = 162, DxUK = "SDLK_WORLD_2" }); dxKeys.Add(new DxKeys { SDLK = 163, DxUK = "SDLK_WORLD_3" }); dxKeys.Add(new DxKeys { SDLK = 164, DxUK = "SDLK_WORLD_4" }); dxKeys.Add(new DxKeys { SDLK = 165, DxUK = "SDLK_WORLD_5" }); dxKeys.Add(new DxKeys { SDLK = 166, DxUK = "SDLK_WORLD_6" }); dxKeys.Add(new DxKeys { SDLK = 167, DxUK = "SDLK_WORLD_7" }); dxKeys.Add(new DxKeys { SDLK = 168, DxUK = "SDLK_WORLD_8" }); dxKeys.Add(new DxKeys { SDLK = 169, DxUK = "SDLK_WORLD_9" }); dxKeys.Add(new DxKeys { SDLK = 170, DxUK = "SDLK_WORLD_10" }); dxKeys.Add(new DxKeys { SDLK = 171, DxUK = "SDLK_WORLD_11" }); dxKeys.Add(new DxKeys { SDLK = 172, DxUK = "SDLK_WORLD_12" }); dxKeys.Add(new DxKeys { SDLK = 173, DxUK = "SDLK_WORLD_13" }); dxKeys.Add(new DxKeys { SDLK = 174, DxUK = "SDLK_WORLD_14" }); dxKeys.Add(new DxKeys { SDLK = 175, DxUK = "SDLK_WORLD_15" }); dxKeys.Add(new DxKeys { SDLK = 176, DxUK = "SDLK_WORLD_16" }); dxKeys.Add(new DxKeys { SDLK = 177, DxUK = "SDLK_WORLD_17" }); dxKeys.Add(new DxKeys { SDLK = 178, DxUK = "SDLK_WORLD_18" }); dxKeys.Add(new DxKeys { SDLK = 179, DxUK = "SDLK_WORLD_19" }); dxKeys.Add(new DxKeys { SDLK = 180, DxUK = "SDLK_WORLD_20" }); dxKeys.Add(new DxKeys { SDLK = 181, DxUK = "SDLK_WORLD_21" }); dxKeys.Add(new DxKeys { SDLK = 182, DxUK = "SDLK_WORLD_22" }); dxKeys.Add(new DxKeys { SDLK = 183, DxUK = "SDLK_WORLD_23" }); dxKeys.Add(new DxKeys { SDLK = 184, DxUK = "SDLK_WORLD_24" }); dxKeys.Add(new DxKeys { SDLK = 185, DxUK = "SDLK_WORLD_25" }); dxKeys.Add(new DxKeys { SDLK = 186, DxUK = "SDLK_WORLD_26" }); dxKeys.Add(new DxKeys { SDLK = 187, DxUK = "SDLK_WORLD_27" }); dxKeys.Add(new DxKeys { SDLK = 188, DxUK = "SDLK_WORLD_28" }); dxKeys.Add(new DxKeys { SDLK = 189, DxUK = "SDLK_WORLD_29" }); dxKeys.Add(new DxKeys { SDLK = 190, DxUK = "SDLK_WORLD_30" }); dxKeys.Add(new DxKeys { SDLK = 191, DxUK = "SDLK_WORLD_31" }); dxKeys.Add(new DxKeys { SDLK = 192, DxUK = "SDLK_WORLD_32" }); dxKeys.Add(new DxKeys { SDLK = 193, DxUK = "SDLK_WORLD_33" }); dxKeys.Add(new DxKeys { SDLK = 194, DxUK = "SDLK_WORLD_34" }); dxKeys.Add(new DxKeys { SDLK = 195, DxUK = "SDLK_WORLD_35" }); dxKeys.Add(new DxKeys { SDLK = 196, DxUK = "SDLK_WORLD_36" }); dxKeys.Add(new DxKeys { SDLK = 197, DxUK = "SDLK_WORLD_37" }); dxKeys.Add(new DxKeys { SDLK = 198, DxUK = "SDLK_WORLD_38" }); dxKeys.Add(new DxKeys { SDLK = 199, DxUK = "SDLK_WORLD_39" }); dxKeys.Add(new DxKeys { SDLK = 200, DxUK = "SDLK_WORLD_40" }); dxKeys.Add(new DxKeys { SDLK = 201, DxUK = "SDLK_WORLD_41" }); dxKeys.Add(new DxKeys { SDLK = 202, DxUK = "SDLK_WORLD_42" }); dxKeys.Add(new DxKeys { SDLK = 203, DxUK = "SDLK_WORLD_43" }); dxKeys.Add(new DxKeys { SDLK = 204, DxUK = "SDLK_WORLD_44" }); dxKeys.Add(new DxKeys { SDLK = 205, DxUK = "SDLK_WORLD_45" }); dxKeys.Add(new DxKeys { SDLK = 206, DxUK = "SDLK_WORLD_46" }); dxKeys.Add(new DxKeys { SDLK = 207, DxUK = "SDLK_WORLD_47" }); dxKeys.Add(new DxKeys { SDLK = 208, DxUK = "SDLK_WORLD_48" }); dxKeys.Add(new DxKeys { SDLK = 209, DxUK = "SDLK_WORLD_49" }); dxKeys.Add(new DxKeys { SDLK = 210, DxUK = "SDLK_WORLD_50" }); dxKeys.Add(new DxKeys { SDLK = 211, DxUK = "SDLK_WORLD_51" }); dxKeys.Add(new DxKeys { SDLK = 212, DxUK = "SDLK_WORLD_52" }); dxKeys.Add(new DxKeys { SDLK = 213, DxUK = "SDLK_WORLD_53" }); dxKeys.Add(new DxKeys { SDLK = 214, DxUK = "SDLK_WORLD_54" }); dxKeys.Add(new DxKeys { SDLK = 215, DxUK = "SDLK_WORLD_55" }); dxKeys.Add(new DxKeys { SDLK = 216, DxUK = "SDLK_WORLD_56" }); dxKeys.Add(new DxKeys { SDLK = 217, DxUK = "SDLK_WORLD_57" }); dxKeys.Add(new DxKeys { SDLK = 218, DxUK = "SDLK_WORLD_58" }); dxKeys.Add(new DxKeys { SDLK = 219, DxUK = "SDLK_WORLD_59" }); dxKeys.Add(new DxKeys { SDLK = 220, DxUK = "SDLK_WORLD_60" }); dxKeys.Add(new DxKeys { SDLK = 221, DxUK = "SDLK_WORLD_61" }); dxKeys.Add(new DxKeys { SDLK = 222, DxUK = "SDLK_WORLD_62" }); dxKeys.Add(new DxKeys { SDLK = 223, DxUK = "SDLK_WORLD_63" }); dxKeys.Add(new DxKeys { SDLK = 224, DxUK = "SDLK_WORLD_64" }); dxKeys.Add(new DxKeys { SDLK = 225, DxUK = "SDLK_WORLD_65" }); dxKeys.Add(new DxKeys { SDLK = 226, DxUK = "SDLK_WORLD_66" }); dxKeys.Add(new DxKeys { SDLK = 227, DxUK = "SDLK_WORLD_67" }); dxKeys.Add(new DxKeys { SDLK = 228, DxUK = "SDLK_WORLD_68" }); dxKeys.Add(new DxKeys { SDLK = 229, DxUK = "SDLK_WORLD_69" }); dxKeys.Add(new DxKeys { SDLK = 230, DxUK = "SDLK_WORLD_70" }); dxKeys.Add(new DxKeys { SDLK = 231, DxUK = "SDLK_WORLD_71" }); dxKeys.Add(new DxKeys { SDLK = 232, DxUK = "SDLK_WORLD_72" }); dxKeys.Add(new DxKeys { SDLK = 233, DxUK = "SDLK_WORLD_73" }); dxKeys.Add(new DxKeys { SDLK = 234, DxUK = "SDLK_WORLD_74" }); dxKeys.Add(new DxKeys { SDLK = 235, DxUK = "SDLK_WORLD_75" }); dxKeys.Add(new DxKeys { SDLK = 236, DxUK = "SDLK_WORLD_76" }); dxKeys.Add(new DxKeys { SDLK = 237, DxUK = "SDLK_WORLD_77" }); dxKeys.Add(new DxKeys { SDLK = 238, DxUK = "SDLK_WORLD_78" }); dxKeys.Add(new DxKeys { SDLK = 239, DxUK = "SDLK_WORLD_79" }); dxKeys.Add(new DxKeys { SDLK = 240, DxUK = "SDLK_WORLD_80" }); dxKeys.Add(new DxKeys { SDLK = 241, DxUK = "SDLK_WORLD_81" }); dxKeys.Add(new DxKeys { SDLK = 242, DxUK = "SDLK_WORLD_82" }); dxKeys.Add(new DxKeys { SDLK = 243, DxUK = "SDLK_WORLD_83" }); dxKeys.Add(new DxKeys { SDLK = 244, DxUK = "SDLK_WORLD_84" }); dxKeys.Add(new DxKeys { SDLK = 245, DxUK = "SDLK_WORLD_85" }); dxKeys.Add(new DxKeys { SDLK = 246, DxUK = "SDLK_WORLD_86" }); dxKeys.Add(new DxKeys { SDLK = 247, DxUK = "SDLK_WORLD_87" }); dxKeys.Add(new DxKeys { SDLK = 248, DxUK = "SDLK_WORLD_88" }); dxKeys.Add(new DxKeys { SDLK = 249, DxUK = "SDLK_WORLD_89" }); dxKeys.Add(new DxKeys { SDLK = 250, DxUK = "SDLK_WORLD_90" }); dxKeys.Add(new DxKeys { SDLK = 251, DxUK = "SDLK_WORLD_91" }); dxKeys.Add(new DxKeys { SDLK = 252, DxUK = "SDLK_WORLD_92" }); dxKeys.Add(new DxKeys { SDLK = 253, DxUK = "SDLK_WORLD_93" }); dxKeys.Add(new DxKeys { SDLK = 254, DxUK = "SDLK_WORLD_94" }); dxKeys.Add(new DxKeys { SDLK = 255, DxUK = "SDLK_WORLD_95" }); // numeric keypad dxKeys.Add(new DxKeys { SDLK = 256, DxUK = "NumberPad0" }); dxKeys.Add(new DxKeys { SDLK = 257, DxUK = "NumberPad1" }); dxKeys.Add(new DxKeys { SDLK = 258, DxUK = "NumberPad2" }); dxKeys.Add(new DxKeys { SDLK = 259, DxUK = "NumberPad3" }); dxKeys.Add(new DxKeys { SDLK = 260, DxUK = "NumberPad4" }); dxKeys.Add(new DxKeys { SDLK = 261, DxUK = "NumberPad5" }); dxKeys.Add(new DxKeys { SDLK = 262, DxUK = "NumberPad6" }); dxKeys.Add(new DxKeys { SDLK = 263, DxUK = "NumberPad7" }); dxKeys.Add(new DxKeys { SDLK = 264, DxUK = "NumberPad8" }); dxKeys.Add(new DxKeys { SDLK = 265, DxUK = "NumberPad9" }); dxKeys.Add(new DxKeys { SDLK = 266, DxUK = "NumberPadPeriod" }); dxKeys.Add(new DxKeys { SDLK = 267, DxUK = "NumberPadSlash" }); dxKeys.Add(new DxKeys { SDLK = 268, DxUK = "NumberPadStar" }); dxKeys.Add(new DxKeys { SDLK = 269, DxUK = "NumberPadMinus" }); dxKeys.Add(new DxKeys { SDLK = 270, DxUK = "NumberPadPlus" }); dxKeys.Add(new DxKeys { SDLK = 271, DxUK = "NumberPadEnter" }); dxKeys.Add(new DxKeys { SDLK = 272, DxUK = "NumberPadEquals" }); // Arrows + Home/End pad dxKeys.Add(new DxKeys { SDLK = 273, DxUK = "UpArrow" }); dxKeys.Add(new DxKeys { SDLK = 274, DxUK = "DownArrow" }); dxKeys.Add(new DxKeys { SDLK = 275, DxUK = "RightArrow" }); dxKeys.Add(new DxKeys { SDLK = 276, DxUK = "LeftArrow" }); dxKeys.Add(new DxKeys { SDLK = 277, DxUK = "Insert" }); dxKeys.Add(new DxKeys { SDLK = 278, DxUK = "Home" }); dxKeys.Add(new DxKeys { SDLK = 279, DxUK = "End" }); dxKeys.Add(new DxKeys { SDLK = 280, DxUK = "PageUp" }); dxKeys.Add(new DxKeys { SDLK = 281, DxUK = "PageDown" }); // Function keys dxKeys.Add(new DxKeys { SDLK = 282, DxUK = "F1" }); dxKeys.Add(new DxKeys { SDLK = 283, DxUK = "F2" }); dxKeys.Add(new DxKeys { SDLK = 284, DxUK = "F3" }); dxKeys.Add(new DxKeys { SDLK = 285, DxUK = "F4" }); dxKeys.Add(new DxKeys { SDLK = 286, DxUK = "F5" }); dxKeys.Add(new DxKeys { SDLK = 287, DxUK = "F6" }); dxKeys.Add(new DxKeys { SDLK = 288, DxUK = "F7" }); dxKeys.Add(new DxKeys { SDLK = 289, DxUK = "F8" }); dxKeys.Add(new DxKeys { SDLK = 290, DxUK = "F9" }); dxKeys.Add(new DxKeys { SDLK = 291, DxUK = "F10" }); dxKeys.Add(new DxKeys { SDLK = 292, DxUK = "F11" }); dxKeys.Add(new DxKeys { SDLK = 293, DxUK = "F12" }); dxKeys.Add(new DxKeys { SDLK = 294, DxUK = "F13" }); dxKeys.Add(new DxKeys { SDLK = 295, DxUK = "F14" }); dxKeys.Add(new DxKeys { SDLK = 296, DxUK = "F15" }); // Key state modifier keys dxKeys.Add(new DxKeys { SDLK = 300, DxUK = "NumberLock" }); dxKeys.Add(new DxKeys { SDLK = 301, DxUK = "CapsLock" }); dxKeys.Add(new DxKeys { SDLK = 302, DxUK = "ScrollLock" }); dxKeys.Add(new DxKeys { SDLK = 303, DxUK = "RightShift" }); dxKeys.Add(new DxKeys { SDLK = 304, DxUK = "LeftShift" }); dxKeys.Add(new DxKeys { SDLK = 305, DxUK = "RightAlt" }); //alt-gr dxKeys.Add(new DxKeys { SDLK = 306, DxUK = "RightControl" }); dxKeys.Add(new DxKeys { SDLK = 306, DxUK = "LeftControl" }); // mednafen appears to map left and right control to the same value (at least on my keyboard) dxKeys.Add(new DxKeys { SDLK = 307, DxUK = "SDLK_RALT" }); dxKeys.Add(new DxKeys { SDLK = 308, DxUK = "LeftAlt" }); dxKeys.Add(new DxKeys { SDLK = 309, DxUK = "SDLK_RMETA" }); dxKeys.Add(new DxKeys { SDLK = 310, DxUK = "SDLK_LMETA" }); dxKeys.Add(new DxKeys { SDLK = 311, DxUK = "LeftWindowsKey" }); dxKeys.Add(new DxKeys { SDLK = 312, DxUK = "RightWindowsKey" }); dxKeys.Add(new DxKeys { SDLK = 313, DxUK = "SDLK_RALT" }); dxKeys.Add(new DxKeys { SDLK = 314, DxUK = "SDLK_COMPOSE" }); // Misc function keys dxKeys.Add(new DxKeys { SDLK = 315, DxUK = "SDLK_HELP" }); dxKeys.Add(new DxKeys { SDLK = 316, DxUK = "PrintScreen" }); dxKeys.Add(new DxKeys { SDLK = 317, DxUK = "SDLK_SYSREQ" }); dxKeys.Add(new DxKeys { SDLK = 318, DxUK = "Pause" }); dxKeys.Add(new DxKeys { SDLK = 319, DxUK = "Applications" }); dxKeys.Add(new DxKeys { SDLK = 320, DxUK = "Power" }); dxKeys.Add(new DxKeys { SDLK = 321, DxUK = "SDLK_EURO" }); dxKeys.Add(new DxKeys { SDLK = 322, DxUK = "SDLK_UNDO" }); }
/// <summary> /// Метод, записывающий данные в поля класса. /// </summary> /// <param name="bodyLength">Длина клавиатуры.</param> /// <param name="bodyHeight">Высота клавиатуры.</param> /// <param name="bodyDepth">Глубина клавиатуры.</param> /// <param name="panelDisplay">Наличие дисплея.</param> /// <param name="panelButtons">Наличие кнопок.</param> /// <param name="panelKnobs">Наличие ручек.</param> /// <param name="panelWheel">Наличие колеса модуляции.</param> /// <param name="commutationXLRSockets">Количество разъемов XLR.</param> /// <param name="commutationTRSSockets">Количество разъемов TRS.</param> /// <param name="commutationMIDISockets">Количество разъемов MIDI.</param> /// <param name="keyboardType">Тип клавиатуры.</param> /// <param name="keyboardKeyAmount">Количество клавиш.</param> public void Record(double bodyLength, double bodyHeight, double bodyDepth, bool panelDisplay, bool panelButtons, bool panelKnobs, bool panelWheel, int commutationXLRSockets, int commutationTRSSockets, int commutationMIDISockets, KeyboardType keyboardType, KeysAmountMode keyAmount) { if (!Validation(bodyHeight, bodyHeightMax, bodyHeightMin, bodyHeightString)) { throw new ArgumentException(); } _bodyHeight = bodyHeight; if (!Validation(bodyDepth, bodyDepthMax, bodyDepthMin, bodyDepthString)) { throw new ArgumentException(); } _bodyDepth = bodyDepth; switch (keyAmount) { case KeysAmountMode.Low: { if (!Validation(bodyLength, bodyLengthLowMax, bodyLengthLowMin, bodyLenghtString)) { throw new ArgumentException(); } _bodyLength = bodyLength; _keyboardKeyAmount = keyAmountLow; _boardLength = boardLengthLow; _whiteKeyAmount = whiteKeyAmountLow; _blackKeyAmount = blackKeyAmountLow; break; } case KeysAmountMode.Middle: { if (!Validation(bodyLength, bodyLengthMiddleMax, bodyLengthMiddleMin, bodyLenghtString)) { throw new ArgumentException(); } _bodyLength = bodyLength; _keyboardKeyAmount = keyAmountMiddle; _boardLength = boardLengthMiddle; _whiteKeyAmount = whiteKeyAmountMiddle; _blackKeyAmount = blackKeyAmountMiddle; break; } case KeysAmountMode.High: { if (!Validation(bodyLength, bodyLengthHighMax, bodyLengthHighMin, bodyLenghtString)) { throw new ArgumentException(); } _bodyLength = bodyLength; _keyboardKeyAmount = keyAmountHigh; _boardLength = boardLengthHigh; _whiteKeyAmount = whiteKeyAmountHigh; _blackKeyAmount = blackKeyAmountHigh; break; } } _panelDisplay = panelDisplay; _panelButtons = panelButtons; _panelKnobs = panelKnobs; _keyboardType = keyboardType; if (!Validation(commutationXLRSockets, xlrSocketsMax, xlrSocketsMin, xlrSocketsString)) { throw new ArgumentException(); } _commutationXLRSockets = commutationXLRSockets; if (!Validation(commutationTRSSockets, trsSocketsMax, trsSocketsMin, trsSocketsString)) { throw new ArgumentException(); } _commutationTRSSockets = commutationTRSSockets; if (!Validation(commutationMIDISockets, midiSocketsMax, midiSocketsMin, midiSocketsString)) { throw new ArgumentException(); } _commutationMIDISockets = commutationMIDISockets; }