1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 16:40:26 +02:00

Fixed issues with key settings, particularly clearing a key binding

This commit is contained in:
Brian Fiete 2020-04-25 06:08:17 -07:00
parent a5ccbab43e
commit 07c2166321
2 changed files with 16 additions and 3 deletions

View file

@ -6846,6 +6846,11 @@ namespace IDE
var window = (WidgetWindow)evt.mSender; var window = (WidgetWindow)evt.mSender;
if (window.mFocusWidget is KeysEditWidget)
{
return;
}
IDECommand.ContextFlags useFlags = .None; IDECommand.ContextFlags useFlags = .None;
var activeWindow = GetActiveWindow(); var activeWindow = GetActiveWindow();
bool isMainWindow = activeWindow.mRootWidget is MainFrame; bool isMainWindow = activeWindow.mRootWidget is MainFrame;

View file

@ -80,7 +80,7 @@ namespace IDE.ui
{ {
if ((evt.mKeyFlags == 0) && if ((evt.mKeyFlags == 0) &&
((evt.mKeyCode == .Delete) || (evt.mKeyCode == .Backspace)) && ((evt.mKeyCode == .Delete) || (evt.mKeyCode == .Backspace)) &&
(Content.HasSelection())) ((Content.HasSelection()) || (!HasKeys)))
{ {
if ((evt.mKeyCode == .Delete) || (evt.mKeyCode == .Backspace)) if ((evt.mKeyCode == .Delete) || (evt.mKeyCode == .Backspace))
{ {
@ -949,9 +949,10 @@ namespace IDE.ui
if (curVariantType == typeof(List<KeyState>)) if (curVariantType == typeof(List<KeyState>))
{ {
if (!newValue.IsEmpty && !newValue.StartsWith("<")) if (!newValue.StartsWith("<"))
{ {
let entries = new List<KeyState>(); let entries = new List<KeyState>();
if (!newValue.IsEmpty)
KeyState.Parse(newValue, entries); KeyState.Parse(newValue, entries);
editingProp.mCurValue = Variant.Create(entries, true); editingProp.mCurValue = Variant.Create(entries, true);
} }
@ -1386,6 +1387,13 @@ namespace IDE.ui
var str = scope String(); var str = scope String();
KeyState.ToString(keyList, str); KeyState.ToString(keyList, str);
if (str.IsEmpty)
{
let origEntry = propEntry.mOrigValue.Get<List<KeyState>>();
if (!origEntry.IsEmpty)
str.Append("< Removed >");
}
valueItem.Label = str; valueItem.Label = str;
} }
else if (curVariantType.IsGenericType) else if (curVariantType.IsGenericType)