Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Wol on September 27, 2006, 09:41:07 PM

Title: Need help ( Input.Device) { Example required }
Post by: Wol on September 27, 2006, 09:41:07 PM
Hi All,

Just can't get my thick head round the Input Device.:-?

Would some nice guy or gal post a "C" example of Input.Device use..

Say, Open the device, wait for something (Mouse/Key/Disk) etc,
then Quit and clean up.

A basic example would be fine, I only require a template to
work with and experiment.


Wol.


PS: Err, forgot to add, it's OS 3x I am progging for..
Title: Re: Need help ( Input.Device) { Example required }
Post by: Thomas on September 28, 2006, 06:48:48 AM
Why do you want to use input.device ? Usually an application has a window and you can use the window's IDCMP port to wait for input events.

Here is an example for how to use IDCMP for a game: http://thomas-rapp.homepage.t-online.de/examples/KeyJoy.c

And here is an example for drawing with the mouse: http://thomas-rapp.homepage.t-online.de/examples/draw.c

Edit: here is an example which waits for a mouse click using input.device (without a window): http://thomas-rapp.homepage.t-online.de/examples/WaitForClick.c

Bye,
Thomas
Title: Re: Need help ( Input.Device) { Example required }
Post by: Wol on September 28, 2006, 06:14:33 PM
Hi Thomas,


The reason I want to use the input device is , I have written
a screen blanker which rotates a 3d cube across all my
monitors (4). The program works fine when active, but I
need to monitor for events while it is sleeping and counting
since the last event before becomming active.

Thx for the links, I will follow them..


Regs:  Wol.
Title: Re: Need help ( Input.Device) { Example required }
Post by: Thomas on September 29, 2006, 02:20:33 PM

Unless you want to run on Kick 1.3 you should rather use a commodity for that.

Bye,
Thomas
Title: Re: Need help ( Input.Device) { Example required }
Post by: hardlink on September 29, 2006, 02:42:18 PM
>> a screen blanker which ... across all my monitors (4).

Four monitors? Cool! How are you doing it? the Amiga chipset and 3 graphics cards? Or a toaster with it's preview outputs?
Title: Re: Need help ( Input.Device) { Example required }
Post by: Wol on September 29, 2006, 08:03:07 PM
@ hardlink,


Yes 3 gfx cards + aga  (A4000 tower)


Wol.