Applescript detect key press by user alternatives on MAC
<p>I have searched and found that Applescript is unable to detect key presses by user. I would like to know is there any other alternatives to do this?</p>

<p>I am building a script for a specific tabs in all internet browser, IE, FF, Chrome, Safari.</p>

<p>1) The specific tab will be blur out, title tab, favicon, URL in address bar will be masked or replace.</p>

<p>2) When the user press "tab" key for example, it will temporary remove all the things that is done in step 1.</p>

<p>3) If the user press tab again, it will go back to the state in step 1.</p>

<p>I have only managed to temporary make the body blur out but not the rest of step 1 and the detecting of key press.</p>

<p>Below is my code :</p>

<pre><code>tell application "Google Chrome"
    set allTabs to front window's tab
    repeat with eachTabs from 1 to count of allTabs
        set eachTab to item eachTabs of allTabs
        if URL of eachTab = "https://web.whatsapp.com/" then
            set currentTab to eachTabs
        end if
    end repeat
    tell front window
        tell tab currentTab
            execute javascript "document.body.style.filter = 'blur(0)'"
        end tell
    end tell
end tell
</code></pre>

<p>I am completely new to this and it's my first time doing this.</p>

<p>Hope you guys can help me out with this. =(</p>

<p>Thanks in advance guys!</p>