473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Putting a character in keyboard buffer

Hi,

Can someone plz tell me the name of the function, which can put characters in keyboard buffer using C. The platform is Linux (Red Hat 9).

What I need to accomplish is: to read characters from serial port and put them in keyboard buffer

Many thanks in advance.
Aug 6 '07 #1
5 5902
The function I've found so far is: SendInput
http://msdn2.microsoft.com/en-us/library/ms646310.aspx

But the problem is, it is a WINAPI function :(

Still lookin' for Posix C function ...


Hi,

Can someone plz tell me the name of the function, which can put characters in keyboard buffer using C. The platform is Linux (Red Hat 9).

What I need to accomplish is: to read characters from serial port and put them in keyboard buffer

Many thanks in advance.
Aug 10 '07 #2
RRick
463 Expert 256MB
In Linux the serial ports are attached to devices with names like: /dev/ttySx where x=0...n. You should be able to treat the device name just like a file name (i.e. "/dev/ttyS0") and use any/most of the C/C++ routines. Things like seek usually don't work with serial ports, but open and read should work fine.

That's the theory, at least, since I've haven't tried it my self. On my linux box I have 8 (0 .. 7) devices, so you're going to have to figure out which one you're using.
Aug 10 '07 #3
Thats right. I am able to pick characters from serial port, but so far, unable to write them on keyboard buffer.
Aug 20 '07 #4
RRick
463 Expert 256MB
What do you mean by keyboard buffer? Are you talking about the input channels (i.e stdin, cin) to a program? A console window? Do you want to spoof the keyboard with other values?

The reason I ask is because the keyboard buffer/values are usually passed to different programs/shells by the window manager.
Aug 20 '07 #5
svlsr2000
181 Expert 100+
have a look at how key board loggers work in linux. you just need to do reverse of that. or else u need to have a psuedo driver in place. Its something similiar to have a ssh connection to pc. I think if you have look at ssh and keyboard loggers would help you alot.
Aug 21 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: herrcho | last post by:
What's the difference between STDIN and Keyboard buffer ? when i get char through scanf, i type in some characters and press enter, then, where do the characters go ? to STDIN or Keyboard...
1
by: Larry | last post by:
Hi my friends. How can I read keyboard buffer by C++ ? Best regards, Larry
5
by: nx-2000 | last post by:
I've got a very large C# forms app and now that its being used in bigger environments we're getting a steady stream of "why does it do this?" problems. The most nagging of which right now is that...
0
by: rs | last post by:
Hi guys, I am trying to read from a USB keyboard using vb.net and HID classes. the USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and is detected in device manager as...
2
by: rs | last post by:
Hi guys, I am trying to read from a USB keyboard using vb.net and HID classes. the USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and is detected in device manager as...
3
by: Jim Langston | last post by:
Is it possible to initialize a std::string with a character array, not neccessarily null terminated? I.E. Given something like this: char buffer; buffer = 0x01; buffer = 0x00; buffer = 'A';...
1
by: Damir | last post by:
Hallo everybody Does anyone knows how to access Keyboard buffer? At the moment I'm catching KeyDown event of the form, and waiting for carrige return or return key, but sometimes the Keyboard...
3
by: muthursyamburi | last post by:
Hello All, I'm really looking for a help in reading/writing the keyboard buffer in AIX (IBM Unix). In DOS, there is some memory addres (I remember it as 0x417) from where the keyboard buffer...
11
by: vbguy2008 | last post by:
Hi, I am coding a Windows Form Application in VB.NET 2008. I would like to clear the keyboard buffer or at least empty all outstanding key presses queued up for my application at certain points...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.