File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ ChordComposer::ChordComposer(const Ticket& ticket) : Processor(ticket) {
2727 config->GetBool (" chord_composer/use_shift" , &use_shift_);
2828 config->GetBool (" chord_composer/use_super" , &use_super_);
2929 config->GetBool (" chord_composer/use_caps" , &use_caps_);
30+ config->GetBool (" chord_composer/finish_chord_on_first_key_release" ,
31+ &finish_chord_on_first_key_release_);
3032 config->GetString (" speller/delimiter" , &delimiter_);
3133 algebra_.Load (config->GetList (" chord_composer/algebra" ));
3234 output_format_.Load (config->GetList (" chord_composer/output_format" ));
@@ -104,7 +106,12 @@ ProcessResult ChordComposer::ProcessChordingKey(const KeyEvent& key_event) {
104106 editing_chord_ = true ;
105107 bool is_key_up = key_event.release ();
106108 if (is_key_up) {
107- if (pressed_.erase (ch) != 0 && pressed_.empty ()) {
109+ if (finish_chord_on_first_key_release_) {
110+ if (pressed_.find (ch) != pressed_.end ()) {
111+ FinishChord ();
112+ pressed_.clear ();
113+ }
114+ } else if (pressed_.erase (ch) != 0 && pressed_.empty ()) {
108115 FinishChord ();
109116 }
110117 } else { // key down
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class ChordComposer : public Processor {
4343 bool use_shift_ = false ;
4444 bool use_super_ = false ;
4545 bool use_caps_ = false ;
46+ bool finish_chord_on_first_key_release_ = false ;
4647
4748 set<int > pressed_;
4849 set<int > chord_;
You can’t perform that action at this time.
0 commit comments