Welcome, Guest. Please login or register.

Author Topic: Need help ( Input.Device) { Example required }  (Read 2493 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline WolTopic starter

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 103
    • Show only replies by Wol
Need help ( Input.Device) { Example required }
« 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..
Only after the last tree has been cut down,
Only after the last river has been poisoned,
Only after the last fish has been caught,
Only then will you find that money cannot be eaten.

--- Cree Indian prophecy ---
 

Online Thomas

Re: Need help ( Input.Device) { Example required }
« Reply #1 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

Offline WolTopic starter

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 103
    • Show only replies by Wol
Re: Need help ( Input.Device) { Example required }
« Reply #2 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.
Only after the last tree has been cut down,
Only after the last river has been poisoned,
Only after the last fish has been caught,
Only then will you find that money cannot be eaten.

--- Cree Indian prophecy ---
 

Online Thomas

Re: Need help ( Input.Device) { Example required }
« Reply #3 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

Offline hardlink

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 586
    • Show only replies by hardlink
Re: Need help ( Input.Device) { Example required }
« Reply #4 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?
 

Offline WolTopic starter

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 103
    • Show only replies by Wol
Re: Need help ( Input.Device) { Example required }
« Reply #5 on: September 29, 2006, 08:03:07 PM »
@ hardlink,


Yes 3 gfx cards + aga  (A4000 tower)


Wol.
Only after the last tree has been cut down,
Only after the last river has been poisoned,
Only after the last fish has been caught,
Only then will you find that money cannot be eaten.

--- Cree Indian prophecy ---