qt - How to fire an event on correct sequence of multiple key sequence? -


hi have created event based on secret sequence of key. if user presses ctrl+alt+o event.

running code snippet

 act = new qaction(this);  act->setshortcut(qkeysequence(qt::ctrl + qt::alt + qt::key_o));  connect(act, signal(triggered()), this, slot(slotclose())); 

now wish extend secret key. want user press 2 sequences. ctrl+alt+to ctrl+alt+y. if these 2 sequences fired in order event fired.

i doubt qkeysequences work.

sure, can!!

all need path constructor:

act->setshortcut(qkeysequence(qt::ctrl + qt::alt + qt::key_o                               , qt::ctrl + qt::alt + qt::key_y)); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -