Skip to content

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

Merged
merged 7 commits into from
Jul 26, 2021

Conversation

gucio321
Copy link
Contributor

@gucio321 gucio321 commented Jun 29, 2021

Hi there,
handling input events deffinitely isn't a part of HellSpawner. since 1dfaa030a55f5ec37408bc26544e6666180fb9e0 giu supports that so we can use built-in input manager.

Copy link
Contributor

@gravestench gravestench left a 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

@gucio321 gucio321 requested a review from gravestench July 12, 2021 19:06
Comment on lines +33 to 41
// 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{}
}
Copy link
Contributor

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?

Copy link
Contributor Author

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:

g.WindowShortcut{Key: g.KeyEscape, Modifier: g.ModNone, Callback: func() { a.closePopups(); a.closeActiveEditor() }},

Comment on lines -113 to -119
// 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)
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@gravestench gravestench merged commit 2a0e033 into OpenDiablo2:master Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants