diff options
Diffstat (limited to 'Native/EmuKeyboardDesigner')
-rw-r--r-- | Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo | bin | 50176 -> 50176 bytes | |||
-rw-r--r-- | Native/EmuKeyboardDesigner/MainForm.cs | 30 |
2 files changed, 26 insertions, 4 deletions
diff --git a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo Binary files differindex 0619df7..aa47a7d 100644 --- a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo +++ b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo diff --git a/Native/EmuKeyboardDesigner/MainForm.cs b/Native/EmuKeyboardDesigner/MainForm.cs index 56887ba..36144b9 100644 --- a/Native/EmuKeyboardDesigner/MainForm.cs +++ b/Native/EmuKeyboardDesigner/MainForm.cs @@ -36,7 +36,7 @@ namespace EmuKeyboardDesigner InitializeComponent();
}
- private void OnSetKey(object sender, EventArgs e)
+ private void SetKey(bool select, bool allowNew)
{
string sym = keysymTextBox.Text;
@@ -54,9 +54,12 @@ namespace EmuKeyboardDesigner key.Height = imageControl.KeyHeight;
key.Sticky = stickyCheckBox.Checked;
- keyList.SelectedItem = key;
+ if (select)
+ {
+ keyList.SelectedItem = key;
+ }
}
- else
+ else if (allowNew)
{
KeyboardKey key = new KeyboardKey()
{
@@ -74,6 +77,11 @@ namespace EmuKeyboardDesigner }
}
+ private void OnSetKey(object sender, EventArgs e)
+ {
+ SetKey(true, true);
+ }
+
private void OnLoad(object sender, EventArgs e)
{
OpenFileDialog fsel = new OpenFileDialog();
@@ -141,6 +149,8 @@ namespace EmuKeyboardDesigner {
if (keyList.SelectedIndex > -1)
{
+ SetKey(false, false);
+
KeyboardKey key = (KeyboardKey)keyList.SelectedItem;
keysymTextBox.Text = key.KeySymbol;
@@ -156,7 +166,19 @@ namespace EmuKeyboardDesigner {
if (keyList.SelectedIndex > -1)
{
- keyList.Items.RemoveAt(keyList.SelectedIndex);
+ int index = keyList.SelectedIndex;
+
+ keyList.Items.RemoveAt(index);
+
+ if (index > keyList.Items.Count - 1)
+ {
+ index--;
+ }
+
+ if (index > -1)
+ {
+ keyList.SelectedIndex = index;
+ }
}
}
}
|