473,383 Members | 1,829 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,383 software developers and data experts.

Reading scancodes under Linux

Hello everyone,

Does someone know of a way to handle both keypress and release in a
Linux-console (not X) from Perl? It seems this is the only way I'll be
able to have keyboard-repeat for some keys, but not for others, or does
anyone have other ideas.

I have done this before in C with:
ioctl(0,KDSKBMODE,K_MEDIUMRAW);

Seems a bit complicated to do the same thing with the perl-ioctl. Also
this will only run on the true terminals. It would be nice to be able to
have it running in a virtual console (xterm) as well for debugging.

Regards,
--
Mikkel Holm Olsen
AKA Spaceman Spiff
Denmark

Alcohol & calculus don't mix. Never drink & derive.

Jul 19 '05 #1
1 3503
Mikkel Holm Olsen <mo*@symlink.dk> wrote in message news:<3f***********************@dread15.news.tele. dk>...
Hello everyone,

Does someone know of a way to handle both keypress and release in a
Linux-console (not X) from Perl? It seems this is the only way I'll be
able to have keyboard-repeat for some keys, but not for others, or does
anyone have other ideas.
I think this is one of those situations where the world is trying to
tell you something. If what you want is hard to get perhaps you are
wanting something inappropriate.
I have done this before in C with:
ioctl(0,KDSKBMODE,K_MEDIUMRAW);

Seems a bit complicated to do the same thing with the perl-ioctl.
How so? Should be essentially the same.
Also
this will only run on the true terminals. It would be nice to be able to
have it running in a virtual console (xterm) as well for debugging.


This has nothing to do with Perl, but the "scancodes" (keyboard
events) that X sends to xterm are probably completely different from
the ones that the keyboard hardware sends.

This newsgroup does not exist (see FAQ). Please do not start threads
here.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: lec | last post by:
Hi, I'm trying to write a program to read from the serial port & write whatever that is read to the X console (/dev/tty7). For X to recognize the characters sent, I believe you have to send...
6
by: Kevin T. Ryan | last post by:
Hi All - I'm not sure, but I'm wondering if this is a bug, or maybe (more likely) I'm misunderstanding something...see below: >>> f = open('testfile', 'w') >>> f.write('kevin\n') >>>...
3
by: LIN | last post by:
I am reading a log file which is being used by the Server every second to log data. I am writing a windows service to read this file. So far, i have been doing this: Copying the file to a...
6
by: David M | last post by:
OK so here is my task. I want to get at the data stored in /var/account/pacct, which stores process accounting data, so that I can make it into a more human understandable format then what the...
6
by: Bob Stearns | last post by:
I am trying to write a small app in php to make the 'COMMENT' statement a bit more friendly, so we might do more documentation. My problem is a set of error statements which have nothing to do with...
6
by: paultawk | last post by:
I have written a prog to read data from files but it only works under windows. Can anyone tell me how to read data under Linux? I would need somehting similar to the following windows code, but...
1
by: bhagyanie | last post by:
Hi ! I have a problem when reading data from a file in C++ in linux. when i ' m reading, the last figure is repeting at the output and same is appering in calculations too. can i have a...
10
by: andmarti | last post by:
Anyone knows if its possible to get scan codes ??? I tried with getch () but with no success, just keycodes. May be using the something in the sys.stdin module ?? Pleasee, any help would be very...
9
by: Hal Vaughan | last post by:
I've done a fair amount of Googling for information on reading the serial port in C++ (and in Linux). Unfortunately, out of every 4 hits, 1 seems to be an unanswered question, 1 is someone saying,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.