-
-
Notifications
You must be signed in to change notification settings - Fork 44
hsapp: remove hsinput; use giu implementation of imput handler #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert .golangci.yml
// RegisterKeyboardShortcuts registers a shortcuts for popup dialog | ||
func (d *Dialog) RegisterKeyboardShortcuts(_ ...giu.WindowShortcut) { | ||
// https://github.com/OpenDiablo2/HellSpawner/issues/327 | ||
} | ||
|
||
// KeyboardShortcuts returns a list of shortcuts | ||
func (d *Dialog) KeyboardShortcuts() []giu.WindowShortcut { | ||
return []giu.WindowShortcut{} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wanted the dialog modal to close when pressing escape, this is where we would define that, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, if we'd like to add shortcut to some specified dialog we need to handle it here. Closing dialogs by escape is currently done here:
Line 260 in 2a0e033
g.WindowShortcut{Key: g.KeyEscape, Modifier: g.ModNone, Callback: func() { a.closePopups(); a.closeActiveEditor() }}, |
// RegisterKeyboardShortcuts adds a local shortcuts for this editor | ||
func (e *DC6Editor) RegisterKeyboardShortcuts(inputManager *hsinput.InputManager) { | ||
// Ctrl+Shift+S saves file | ||
inputManager.RegisterShortcut(func() { | ||
e.Save() | ||
}, g.KeyS, g.ModShift+g.ModControl, false) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this ctrl
+shift
+s
hotkey being registered elsewhere, now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it isn't, however, I'm not really sure if this shortcut is necessary. saving editor data takes place on ctrl+s and this shortcut is registered in hsapp.
Hi there,
handling input events deffinitely isn't a part of HellSpawner. since 1dfaa030a55f5ec37408bc26544e6666180fb9e0
giu
supports that so we can usebuilt-in
input manager.