This is a real toughy...

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

This is a real toughy...

Postby Bazza » Thu Jul 08, 2010 8:46 pm

Whatever I ask usually has a serious reply of 0, zero, so I
suspect this will be no different...

How do I read the two Caps Shift keys in "real time" under a
Linux GUI of any kind.

Code can be in C, C++, Assembly I don`t care just give me a clue.

I can EASILY do it in MikeOS and at least Windows up to Vista
but Linux has got me stumped...
73...

Bazza, G0LCU...

Team AMIGA...
User avatar
Bazza
LXF regular
 
Posts: 1483
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

xev

Postby tuxmando » Thu Jul 08, 2010 9:42 pm

While in X, you can launch xev (X Event Viewer) to see info about key presses. It will give you codes for keydown and release. Your chosen language should have libraries to check for keypresses. Mix together and see...
tuxmando
 
Posts: 98
Joined: Fri Jul 27, 2007 1:35 pm

Postby tuxmando » Thu Jul 08, 2010 10:02 pm

See http://stanislavs.org/helppc/int_16.html for info on doing it in asm.
tuxmando
 
Posts: 98
Joined: Fri Jul 27, 2007 1:35 pm

Postby tuxmando » Thu Jul 08, 2010 10:12 pm

http://cs.haifa.ac.il/courses/com_org/2006/int16.htm part way down there's an example for assembly.

The idea is to put a value of 2 into register AH, do int16h, then read flags from register AL...
tuxmando
 
Posts: 98
Joined: Fri Jul 27, 2007 1:35 pm

Postby Bazza » Fri Jul 09, 2010 2:36 am

Hi tuxmando...

Ooooh, I`m up at this time because I can`t sleep...

Thanks for the info but........

1) Xev does not display what I want, it does not allow for
a SIMULTANEOUS keypress of both Caps shifts...

I`ll be a bit more specific. I need to be able to READ the
Left Caps shift or the Right Caps Shift or BOTH simultaneously
or neither of bits 0 and 1 of absolute adress 0x417H, NOTE, in
"real time". I WILL eventually need to be able to write to bits
5 and 6 in exactly the same way to exactly the same address
also in "real time" in Linux, (preferably a GUI), and yes this can
be done...

2) I already know how to access absolute address 0x417H
in 16 bit assembly... I need to be able to read/write to the
same said address without getting a Segmentation Fault in
Linux assembly, (or C++), - OUCH!

3) I already know about Interrupts and their usage. And the
code you pointed to will not work under Linux. I have already
done direct access of absolute address 0x417H for MikeOS
and Windows for my needs but Linux eludes me. Also calling
BIOS interrupts inside Linux is not exactly easy. :O

Thanks for all your efforts though... :)
73...

Bazza, G0LCU...

Team AMIGA...
User avatar
Bazza
LXF regular
 
Posts: 1483
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby tuxmando » Fri Jul 09, 2010 6:06 am

No worries :)
tuxmando
 
Posts: 98
Joined: Fri Jul 27, 2007 1:35 pm


Return to Programming

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests