Input keyboard keys upon program launch


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Input keyboard keys upon program launch
# 1  
Old 11-02-2012
Input keyboard keys upon program launch

Hey guys, first post! I want to write a script that will wait 1 second and then input the keys CTRL+ALT+J to the application i just opened.

The program is dosbox, and thay key combination starts video recording Smilie I have no idea how to program this, can anyone help please?

thanks in advance!
# 2  
Old 11-02-2012
You could use "expect" for this kind of tasks. See the documentation of "expect" and download and install it onto your system if it isn't already there.

I hope this helps.

bakunin
# 3  
Old 11-02-2012
thank you! i will read about that, in the meanwhile, i was able to figure out how to do it on vbscript. The script itself launches the application, waits a little bit, and then sends keys, something like this for bash would be perfect to me! Gonna do some research and post results when i do find some

Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "dosbox", 9
WScript.Sleep 1500 
WshShell.SendKeys "^j"

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read input from Keyboard, do not proceed if no input

Hi, I am working on a script, which requests users to enter input. Ex: read -p "Please enter your email id:" email I don't want users skipping this entry, this has to be mandatory.I dont want to proceed without input. I can do a check if variable $email is empty and proceed if not.But, i... (7 Replies)
Discussion started by: aravindadla
7 Replies

2. Solaris

Keys on Keyboard stop working

Hello, I hope I put this in the right forum... I searched for similar threads, but I couldn't find any that seem to deal with the problem I am having. My workplace is using (among other Solaris-machines) Dell Dimension T3500 as workstations (running Solaris 10 X86 10/09 u8,... (0 Replies)
Discussion started by: areichart
0 Replies

3. Shell Programming and Scripting

Shell Script to launch C program

Hi there, im new too shell scripting and was wondering if it is possible to create a shell script to take in a variable and load a c program. My C program is a file monitor, and is started by using the terminal and using to following code ./monitor FileToBeMonitored is it possible to have... (12 Replies)
Discussion started by: gazmcc182
12 Replies

4. Linux

How to read keys from USB keyboard on AT91SAM9260

Hi Everyone, I am using 2.6.26.3-olimex kernel(Embedded system) running on AT91SAM9260. I am using a Logitech USB keyboard. It is detected as "/dev/input/event0". I don't know how to detect key press events and read the keys? Why can't I read the keys using scanf() like funtions? ... (7 Replies)
Discussion started by: siva4ever
7 Replies

5. SCO

SCO 6.0-Keys in keyboard function differently

Sir I have HP installed with SCO 6.0. The problems are (1) some keys in board like 'del' 'backspace', 'pageup/dn" do not function and display some special characters on conole. (2) Files transferred from Windows machine invariably contain control Z/M characters. How to resolve these issues. ... (4 Replies)
Discussion started by: chssastry
4 Replies

6. Programming

Problem with external program launch

Hello, in the application i'm writing i need to launch "recordmydesktop" to capture the screen,but i'm having a problem: when the recording stops,and the encoding of the saved file starts,the entire system hangs until the completion of the encoding.This happens if i launch recordmydesktop from my... (7 Replies)
Discussion started by: Zipi
7 Replies

7. Shell Programming and Scripting

BASH: how to launch a program with parameters

Hi, I'm a pretty big fan of BASH scripting. I've got a bunch I use for random things and lately a couple issues have been plaguing me. Both are somewhat related, in that they deal with filenames with spaces and "escaped" characters and with launching a program with command line arguements... (5 Replies)
Discussion started by: TinCanFury
5 Replies

8. Programming

launch an executable from a C++ program

Hi everybody! Could you please tell me how can I launch an executable from a C++ (on unix) program? thanks in advance! (2 Replies)
Discussion started by: nadiamihu
2 Replies

9. UNIX for Dummies Questions & Answers

how to launch program though telnet

I have launched telnet on nt and have connected to a unix server, I'm trying to run a program on the unix server which will launch a gui, but when I try to launch it I get the message "display not set\n" "By default set it to 0.0" I can sit down at the unix machine and launch the program with... (3 Replies)
Discussion started by: cbachman
3 Replies
Login or Register to Ask a Question