summaryrefslogtreecommitdiff
path: root/Native
diff options
context:
space:
mode:
Diffstat (limited to 'Native')
-rw-r--r--Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suobin50176 -> 50176 bytes
-rw-r--r--Native/EmuKeyboardDesigner/MainForm.cs30
2 files changed, 26 insertions, 4 deletions
diff --git a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
index 0619df7..aa47a7d 100644
--- a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
+++ b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
Binary files differ
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;
+ }
}
}
}