Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

This is a real toughy...

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1477
Location: Loughborough

PostPosted: Thu Jul 08, 2010 9:46 pm    Post subject: This is a real toughy... Reply with quote

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...
Back to top
View user's profile Send private message
tuxmando



Joined: Fri Jul 27, 2007 2:35 pm
Posts: 98

PostPosted: Thu Jul 08, 2010 10:42 pm    Post subject: xev Reply with quote

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...
Back to top
View user's profile Send private message
tuxmando



Joined: Fri Jul 27, 2007 2:35 pm
Posts: 98

PostPosted: Thu Jul 08, 2010 11:02 pm    Post subject: Reply with quote

See http://stanislavs.org/helppc/int_16.html for info on doing it in asm.
Back to top
View user's profile Send private message
tuxmando



Joined: Fri Jul 27, 2007 2:35 pm
Posts: 98

PostPosted: Thu Jul 08, 2010 11:12 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1477
Location: Loughborough

PostPosted: Fri Jul 09, 2010 3:36 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
tuxmando



Joined: Fri Jul 27, 2007 2:35 pm
Posts: 98

PostPosted: Fri Jul 09, 2010 7:06 am    Post subject: Reply with quote

No worries Smile
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast