Sending key events to background script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sending key events to background script
# 1  
Old 02-20-2011
Sending key events to background script

Hi,

short summary:
I need to send keystrokes from USB keyboard to background (bash-)script. I guess I have to use read on the right devive board but how and which?

My details:

I got a small home server with some VMs using KVM/Qemu, all are suse 11.3. But in general I work on a client using a keyboard switch. Additionally, I have a scanner (HP Officejet 6500).

Now I want to send scans into a VM. I did not get the scan button to work but I want to achieve a similar solution. I bought a numerical keyboard with USB connector, connected it to the server and fowarded the port into the target VM.
Next there should be a background process listening to that kayboard and running a variety of scanimage scripts when the numbers are pressed.

I found the keyboard device under /dev/input/by-id/... and probably also under /dev/bus/usb/001/00[1-4]. Unfortunately, the output looks very "raw". I guess there must be an other device to connect to?

Thank you for your help,
Snowman
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help regarding sending sleep to background

Hi, can we print anything, when sleep is running..? like printing dots(.. . . . . . . . .) to indicate that some process is going on...? i mean, can we send sleep to background, proceed with printing, till sleep is going on... in s single step. I have written a funtion to solve this. ... (1 Reply)
Discussion started by: Dpu
1 Replies

2. Programming

Simulating background X11 events

Hi everybody! I've following this forum for a while but now it is my turn to do a question since a did not find the answer anywhere (I've been searching for days and there is no way). I am working on a client-server platform where the server renders 3D models and sends images to the client... (3 Replies)
Discussion started by: benderz
3 Replies

3. Shell Programming and Scripting

Sending Key Presses

Hi. Im wondering if there is a way to output key presses using a script? Something like this: key=down key=down key=up So say if it was sent to Firefox it would make the window scroll down twice then up once. (1 Reply)
Discussion started by: Grizzly
1 Replies

4. Shell Programming and Scripting

sending email as background process

Hi All, Solaris Bash v3x I have a script that accepts an error code, and if the error code is not 0 then an email is sent using mailx to details the error. I want to be able to implement the functiuonlity whereby i can send the email in a background process so the script can continue with... (3 Replies)
Discussion started by: satnamx
3 Replies

5. Programming

capture key board events using C program

hi This is mahesh please can any one post source of 'c'. to capture key board events. thank u (1 Reply)
Discussion started by: smahesh2007
1 Replies

6. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

7. UNIX for Dummies Questions & Answers

Creating keymaps/key events

Hi all, Total newbie here so sorry for any offence caused... Anyway totally a windows slave, only ever used that, closest i got to programming was in DOS and HTML, yeah i know doesn't compare but just setting up the background. Have installed Cygwin and have learned a bit about Unix and... (0 Replies)
Discussion started by: newbiex25
0 Replies

8. Programming

Sending INtr key for remote terminal

Hi folks, Just wondering if anyone knows how to send intr/break key to remote tty (shell), a simple example would be great! thx (2 Replies)
Discussion started by: andryk
2 Replies
Login or Register to Ask a Question
usb-devices(1)							Linux USB Utilities						    usb-devices(1)

NAME
usb-devices - print USB device details SYNOPSIS
usb-devices DESCRIPTION
usb-devices is a (bash) shell script that can be used to display details of USB buses in the system and the devices connected to them. The output of the script is similar to the usb/devices file available either under /proc/bus (if usbfs is mounted), or under /sys/ker- nel/debug (if debugfs is mounted there). The script is primarily intended to be used if the file is not available. In contrast to the usb/devices file, this script only lists active interfaces (those marked with a "*" in the usb/devices file) and their endpoints. Be advised that there can be differences in the way information is sorted, as well as in the format of the output. RETURN VALUE
If sysfs is not mounted, a non-zero exit code is returned. FILES
/sys/bus/usb/devices/usb* The part of the sysfs tree the script walks through to assemble the printed information. /proc/bus/usb/devices Location where the usb/devices file can normally be found for Linux kernels before 2.6.31, if usbfs is mounted. /sys/kernel/debug/usb/devices Location where the usb/devices file can normally be found for Linux kernel 2.6.31 and later, if debugfs is mounted. SEE ALSO
lsusb(8), usbview(8). AUTHORS
Greg Kroah-Hartman <greg@kroah.com> Randy Dunlap <rdunlap@xenotime.net> Frans Pop <elendil@planet.nl> usbutils-007 23 June 2009 usb-devices(1)