All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luciano Miguel Ferreira Rocha <luciano@lsd.di.uminho.pt>
To: linux-assembly@vger.kernel.org
Subject: Re: Keyboard and Mouse library
Date: Tue, 15 Jul 2003 20:54:22 +0100	[thread overview]
Message-ID: <20030715195422.GA17942@lsd.di.uminho.pt> (raw)
In-Reply-To: <200307160303.16120.jko@save-net.com>


Yes. Don't use Linux.

Linux is an OS kernel. It's very purpose is to remove the requirement for
people to directly program the keyboard controler and/or serial/psaux port and
the attached mouse. All devices are presented as files.

The hardware abstraction in Linux allows programs to be used remotely and
still assume a keyboard and a mouse.

Anyway, you can access serial mice as a normal serial device via /dev/ttySx,
and keycodes by setting the terminal to raw.

PS/2 mice go to /dev/psaux and USB to /dev/input/mouse*

Also, gpm can be used to convert from one protocol to another (bus mouse ->
serial, etc.).

Regarding keyboard, you can read characters by reading from stdin (file
descriptor 0), and control it with ioctl calls.

Relevant man pages: console_codes console_ioctl mouse ttyS ...

I recomend you get a C programming book and another for Unix.

You'll see C has its benefits over assembly.

Regards,
Luciano Rocha

On Wed, Jul 16, 2003 at 03:03:15AM -0700, jeff wrote:
> Hello,
> I'm trying to create a linux library and running into
> trouble with the mouse.  The intent was to use kernel
> calls only and run from the user level.  Is this
> possible?
> 
> I've looked at Gpm which works with terminals
> but find the "c" code difficult.  Assembler for me
> is much easier to understand.
> 
> Also, it would be nice to get the raw keyboard scan
> codes.  I've found programs that claim to do this
> but they don't work on my 9.1 Mandrake version
> of Linux?
> 
> Any suggestions or ideas?
> 
> Jeff Owens
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2003-07-15 19:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-15 13:19 Q: -fpic and $_GLOBAL_OFFSET_TABLE_ Oleg Nesterov
2003-07-15 23:24 ` hp
2003-07-16 10:03 ` Keyboard and Mouse library jeff
2003-07-15 19:54   ` Luciano Miguel Ferreira Rocha [this message]
2003-07-15 23:15   ` hp
2003-07-16  6:49     ` hp
2003-07-17  7:17     ` jeff
2003-07-16  3:09   ` linuxassembly
2003-07-16  6:46     ` hp
2003-07-16  8:07       ` linuxassembly
2003-07-17 16:45         ` Maciej Hrebien
2003-07-17 19:26           ` linuxassembly
2003-07-17 20:11             ` Maciej Hrebien
2003-07-17 22:12             ` hp
2003-07-17 12:29     ` jeff
2003-07-17 20:14       ` Konstantin Boldyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030715195422.GA17942@lsd.di.uminho.pt \
    --to=luciano@lsd.di.uminho.pt \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.