From: <can...@li...> - 2007-04-25 12:32:50
|
can...@li... pravi: > Hi guys, > > I was thinking it would be nice to have Canorus act more like a > "musical typewriter": for example, type C and a C appears on the staff, > sort of like "speedy entry" mode in Finale, but with Lilypond-like > keys. Point and click is nice, but it is way more efficient to type in > the notes. > IMO LilyPond way as it is now is much faster. User only needs to know the pretty easy Lily syntax. But that's only my taste of course :) > This is also a good opportunity to refactor the keypress code in > mainwin.cpp. IMO CAMainWin::viewPortKeyPressEvent() should be split > into separate functions; the existing method should just figure out > what key has been pressed and then call the appropriate function to do > the work. And as long as that code is changing it would be worthwhile > to make key bindings more configurable as well. > Agreed. viewPortKeyPressEvent() should forward the call dependent on the current mode, viewport type, key pressed etc.. > I have working code that implements this; I haven't committed it since > it's more than a trivial change. Attached is a patch with the changes > (against R461), as well as two new files (keybindings.cpp/h) that > handle mapping keys to actions. Please comment. > I'll look at it and test it further on Friday. keybindings.cpp/h should go to src/ui subdirectory. Change the header message to your copyright. The patch looks nice though. Just don't commit the translations. On the other hand, I prefer using QActions for key bindings. AFAIK they are there to substitute your CAKeyAction. This way, a key settings dialog for setting a custom key to custom action might be easier to implement in the future as this is the standard way. Regards. - Matevz |