Score:0

Use xdotool to send special characters

au flag
Ted

I am trying to control the volume of omxplayer while the track is playing. I can use the keyboards + and keys. However I want to control the volume using a python script. The following script works to pause and unpause omxplayer, by sending p using xdotool.

xdotool does not accept special characters. Is there a work around for this?

When I replace the p with + or , I get the following error:

Error: Invalid key sequence '-'
Failure converting key sequence '-' to keycodes
Error: Invalid key sequence '-'
Failure converting key sequence '-' to keycodes
xdo_send_keysequence_window reported an error for string '-'

Here is the script that I am using:

threading.Thread(target=play_clip).start()
print"startng tone"
time.sleep(1)
while a==1:
    print 'ttt'
    time.sleep(1)
    os.system('xdotool key p')
    time.sleep(1)
    os.system('xdotool key p')
Score:0
cn flag
xdotool key minus plus

will simulate hitting -and +.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.