Simple mouse Driver
-
- Posts: 17
- Joined: Sat Jan 12, 2013 7:37 am
Simple mouse Driver
this kind of goes along with my GUI question but I need mouse support. All I want is a simple driver that can draw a small square at MouseX and MouseY. The only click I want to handle is a left button down. does anyone have a good tutorial or some simple code much prefer it in C/C++
REAL programmers aren't afraid to use goto's
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Simple mouse Driver
The is no such thing like "C/C++", which is just an undefined behavior in both C and C++.
If you want spoonfeeding (and you clearly want, since you're using phrases like "I want" in meaning "do it for me"). Pick up another hobby, maybe jogging* or something. There are tutorials, but you are supposed to find them by yourself (the most important programming skill of all: Googling and using "Search" buttons).
(* yes, I know, a repeated joke ceases to be funny, but the previous usage of it has been deleted :F)
If you want spoonfeeding (and you clearly want, since you're using phrases like "I want" in meaning "do it for me"). Pick up another hobby, maybe jogging* or something. There are tutorials, but you are supposed to find them by yourself (the most important programming skill of all: Googling and using "Search" buttons).
(* yes, I know, a repeated joke ceases to be funny, but the previous usage of it has been deleted :F)
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: Simple mouse Driver
* You need to write your own code to make an operating system.
* Making other people do the work doesn't make it your OS.
* Understanding how to find information and translating it to your own code is vital for OS-dev.
* Making other people do the work doesn't make it your OS.
* Understanding how to find information and translating it to your own code is vital for OS-dev.
-
- Posts: 17
- Joined: Sat Jan 12, 2013 7:37 am
Re: Simple mouse Driver
the problem with google is that things get so generic. I tried looking it up, but I got stuff for like windows and Linux with pre-made Libraries for you to use. I don't want to write driver for an existing OS. I want to write it for my OS. when I try to get more specific I get nothing useful
REAL programmers aren't afraid to use goto's
Re: Simple mouse Driver
Hi,
Cheers,
Brendan
Start at the main page for the OSdev wiki. Then type in "mouse" into the wiki's search box, and click the first result (a page about mouse input).JamesParsons wrote:the problem with google is that things get so generic. I tried looking it up, but I got stuff for like windows and Linux with pre-made Libraries for you to use. I don't want to write driver for an existing OS. I want to write it for my OS. when I try to get more specific I get nothing useful
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
-
- Posts: 17
- Joined: Sat Jan 12, 2013 7:37 am
Re: Simple mouse Driver
what header file are the outportb, inportb, and irq_install_handler in.
REAL programmers aren't afraid to use goto's
Re: Simple mouse Driver
Hi,
Cheers,
Brendan
They're in whichever header file you felt like putting them in.JamesParsons wrote:what header file are the outportb, inportb, and irq_install_handler in.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Simple mouse Driver
Remember that this is kernel land. It's a wonderful magical new world where you can construct a whole reality - but it is a void when you start construction. There is nothing there except that you build yourself. So when you ask "where is foo?" you are already making a mistake; you have to build foo yourself and then you have the answer to your question.
When tutorial code use function with a given name, the author didn't expect you to have a function that works exactly like that, but the name is a hint to what kind of function. In this case, the author expects you to have support for reading and writing IO ports and have an interrupt handler (IRQs).
When tutorial code use function with a given name, the author didn't expect you to have a function that works exactly like that, but the name is a hint to what kind of function. In this case, the author expects you to have support for reading and writing IO ports and have an interrupt handler (IRQs).
-
- Posts: 17
- Joined: Sat Jan 12, 2013 7:37 am
Re: Simple mouse Driver
OK I can do that with inline assembly
REAL programmers aren't afraid to use goto's