Add proper and reliable (i hope) support for modifier keys

This commit is contained in:
Sasha Koshka 2022-11-22 00:21:35 -05:00
parent 8c28c57925
commit ae514f5ae2
8 changed files with 38 additions and 15 deletions

View File

@ -45,7 +45,7 @@ func (application *Application) OnQuit (
// OnPress registers an event handler to be called when a key or mouse button // OnPress registers an event handler to be called when a key or mouse button
// is pressed. // is pressed.
func (application *Application) OnPress ( func (application *Application) OnPress (
onPress func (button Button), onPress func (button Button, modifiers Modifiers),
) { ) {
application.callbackManager.onPress = onPress application.callbackManager.onPress = onPress
} }

View File

@ -91,7 +91,9 @@ func (backend *Backend) handleButtonPress (
backend.compressScrollSum(&sum) backend.compressScrollSum(&sum)
backend.callbackManager.RunScroll(sum.x, sum.y) backend.callbackManager.RunScroll(sum.x, sum.y)
} else { } else {
backend.callbackManager.RunPress(stone.Button(buttonEvent.Detail + 127)) backend.callbackManager.RunPress (
stone.Button(buttonEvent.Detail + 127),
stone.Modifiers { })
} }
} }