Stefan 92 Posted April 16, 2014 Share Posted April 16, 2014 Hello, I need python code for logininfo.py that assign some task (opening or import other file) for e.g. F7 key. Can someone help me? I don't know python Link to comment Share on other sites More sharing options...
Denis 1474 Posted April 16, 2014 Share Posted April 16, 2014 Just write import your_module_name into logininfo.py Link to comment Share on other sites More sharing options...
Stefan 92 Posted April 16, 2014 Author Share Posted April 16, 2014 I know but I need to run it on hotkey Link to comment Share on other sites More sharing options...
Denis 1474 Posted April 16, 2014 Share Posted April 16, 2014 Try this import ui import app START = TRUE HOTKEY_DOWN = FALSE def hotkey(): global HOTKEY_DOWN,START if (app.IsPressed(app.DIK_F5) == FALSE): HOTKEY_DOWN = FALSE if (app.IsPressed(app.DIK_F5) == TRUE and HOTKEY_DOWN == FALSE): HOTKEY_DOWN = TRUE if (START == FALSE): START = TRUE execfile("file.py",{}) else: START = FALSE test = ui.Window() test.OnUpdate = hotkey test.Show() 2 Link to comment Share on other sites More sharing options...
Stefan 92 Posted April 17, 2014 Author Share Posted April 17, 2014 Try this import ui import app START = TRUE HOTKEY_DOWN = FALSE def hotkey(): global HOTKEY_DOWN,START if (app.IsPressed(app.DIK_F5) == FALSE): HOTKEY_DOWN = FALSE if (app.IsPressed(app.DIK_F5) == TRUE and HOTKEY_DOWN == FALSE): HOTKEY_DOWN = TRUE if (START == FALSE): START = TRUE execfile("file.py",{}) else: START = FALSE test = ui.Window() test.OnUpdate = hotkey test.Show() Problem solved, thanks for help Denic #closerequest Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now