0

I am trying to port a script from AHK script for Windows to Python script for Ubuntu.

Desired behavior

(1) If user presses F5 when active window is explorer it displays message "explorer is active". (2) If user presses control-F6 when active window is explorer it displays message "Ctrl-F6 was pressed". (3) If user presses F5 when active window is NOT explorer it displays a tooltip "Active app IS NOT explorer". (4) If user presses control-F6 when active window is NOT explorer nothing happens.

AHK implementation:

#IfWinActive ahk_exe explorer.exe    
F5::MsgBox % "explorer IS active"   /* scenario 1*/
^F6::MsgBox % "Ctrl-F6 was pressed"    /* scenario 2*/        
#if
F5::ToolTip % "Active app IS NOT explorer"      /* scenario 3*/

How to do this in Python under Ubuntu?

3
  • 1
    See askubuntu.com/q/918464/295286 It's basically Python approach that makes use of clipboard. Jul 18, 2018 at 14:00
  • This sounds like a Windows question... Jul 18, 2018 at 17:57
  • This is Ubuntu question. Simple script does this under Windows (see script below - it is working). But I can't adapt it for Linux...
    – Stepan
    Jul 20, 2018 at 2:27

0

You must log in to answer this question.

Browse other questions tagged .