static JLabel showSuggestion_current; sbool showSuggestion_keyListenerInstalled; // action is called in new thread static JLabel showSuggestion_master(fS suggestionText, fO action) { hideSuggestion(); ret showSuggestion_makeMaster(showSuggestion_individual(suggestionText, action)); } static JLabel showSuggestion_makeMaster(JLabel label) { JButton btnOK = firstButton(getWindow(label)); setText(btnOK, getText(btnOK) + appendBracketed(hotKey_teach()); showSuggestion_current = label; showSuggestion_installHotkey(); ret label; } svoid showSuggestion_installHotkey { if (showSuggestion_keyListenerInstalled) ret; showSuggestion_keyListenerInstalled = true; onGlobalHotKey(hotKey_teach(), r-awt { bool b = isComponentShowing(showSuggestion_current); print("hotkey: " + b); if (b) clickFirstButton(getWindow(showSuggestion_current)); }); }