Jump to content

autoKey script for switch beetween players view and observer view


Recommended Posts

 

what: python autoKey script (you need measure your screen dimensions and adapt)

use:

F1 = player 1 view and select CC of player 1 (eventual you want jump to railway point later)

F1,F1 = observer view

import time
x = 1700
y = 10
y1 = 10
mouse.click_relative(x,y,1)
playerNumer = 1
y += (2+playerNumer)*28
mouse.click_relative(x,y,1)
keyboard.send_keys('<ctrl>+c')
# keyboard.send_keys('ä') # select relayPoint

# set eventually to Observer if double click
# retCode = keyboard.wait_for_keypress('d',modifiers=['<ctrl>'],timeOut=3) # works
# retCode = keyboard.wait_for_keypress('<f1>',modifiers=['<ctrl>'],timeOut=3) # works
time.sleep(.10)
# retCode = keyboard.wait_for_keypress('<f1>') # works
retCode = keyboard.wait_for_keypress('<f1>',modifiers=[],timeOut=1)
# retCode = keyboard.wait_for_keypress('f9',modifiers=[''],timeOut=3)
if retCode:
    # set to Observer
    mouse.click_relative(x,y1,1)
    playerNumer = 0
    y = 0 + (2+playerNumer)*28
    # y += y1 + 28
    time.sleep(.10)
    mouse.click_relative(x,y,1)
    # myMessage = 'Wait for keypress exit code was: ' + str(retCode)
    # dialog.info_dialog(title='You pressed <ctrl>+d')

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...