5digits / dactyl

Pentadactyl and other related Gecko extensions
Other
469 stars 98 forks source link

qmarks vs. capturing a keypress (more of a Javascript question) #217

Open for-coursera opened 7 years ago

for-coursera commented 7 years ago

Since I use qmarks quite a lot, I've made this little selector in case I forgot where exactly my quickmarks are pointing to:

javascript <<EOF
function showActQmarks(){
    dactyl.execute("qmarks");
    // get a qmark
    q = prompt("Visit..?");
    dactyl.execute("normal <Esc>");
    // abort if no input provided
    if (q == null || q == "") {
        return;
        }
    // navigate
    dactyl.execute("normal " + "go" + q);
}
EOF

However, this also made me wonder, if it's possible to capture a key pressed by a user after executing the :qmarks command without that ugly prompt method?

Thanks :)