Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Debug Mode in OSX?  (Read 2276 times)
0 Members and 1 Guest are viewing this topic.
Offline fabi

Innocent Bystander





« Posted 2006-05-07 13:08:42 »

Hi,

I just switched to Mac and i found that the JInput class is precompiled with "Debug on" (i assume) - when I use it, it keeps outputting debug messages like

Queue getNextEvent return value: 0
Queue getNextEvent return value: 0
Queue getNextEvent return value: 0
Queue getNextEvent return value: 0

Can anybody help me with that? Or does anybody have the same problem?
Offline Coldstone

Senior Newbie





« Reply #1 - Posted 2006-05-27 21:07:51 »

There have been previous discussions of this issue (see previous posts).  I am currently not aware if there will be a resultion for this issue.  Hopefully a future release of JInput will control the debug behavior with a runtime parameter.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #2 - Posted 2006-10-27 23:28:10 »

It's been 120 days, apparently, so I hope this was resolved.

It's incredibly annoying to see literally hundreds of debug messages in a few short seconds, especially because I often rely heavily on the console in order to debug my own programs (of course). Seriously, this is really really turning me off to JInput and making it impossible to test out. I was attempting to experiment with keyboard access and trying to have the buttons I pressed printed into the console, but naturally this is impossible when it's filled with garbage.

Is there a solution, or am I going to have to give up on JInput before I even got started (this really is a ridiculous deterrent to my programming)?

See my work:
OTC Software
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #3 - Posted 2006-10-29 20:48:29 »

Try this build.

HTH

Endolf

P.S. I don't have access to an OSX machine, so I don't know what it will do, but it's the latest code from CVS.

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #4 - Posted 2006-11-07 06:55:37 »

Yeah, that's a lot lot newer than what I downloaded, cool. I'll let you know how it works when I get back to the project.

Hey, do you know any quick tutorials that show me how to get a hold of the mouse axes, or an example? I can't find a simple 10 line example anywhere, and I can't figure out how to get what I need out of the mouse object.

See my work:
OTC Software
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #5 - Posted 2006-11-07 07:27:21 »

Hi

This is off the top of my head. It almost certainly won't compile, and probably won't run even when you get past that, but it should be along the right lines Smiley.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
// Get the environment and all controllers.
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
// Loop through them all, there may be more than one mouse remember.
for(Controller tempController : controllers) {
    // If it's a mouse, we are interested
   if(tempController.getType()==Controller.Type.MOUSE) {
        // Get the X axis
       Component xAxis = tempController.getComponents(Component.Identifier.Axis.X);
        //Get the Y axis
       Component yAxis = tempController.getComponents(Component.Identifier.Axis.Y);
    }
}


You can then poll the device (50 times a second is good otherwise the OS buffers tend to fill up) and then grab the values of those axis.

The other way, is to get just the device like above, then call
1  
getEventQueue()
on it, poll it every 50th of a second and then call
1  
getNextEvent()
on the event queue. Each event will have the identifier of the axis it's for and you can just check that for
1  
Component.Identifier.Axis.X
and
1  
Component.Identifier.Axis.Y


HTH

Endolf

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #6 - Posted 2006-11-07 07:35:06 »

Ah, cool, I see it exactly, then. Yeah, I had it figured out how to get input from the Mouse before you replied to this, but I could only see how to get different values by using the string "human" name. I see how the constants apply here.

I have another question after messing around with the mouse some. My Mouse apparently has 5 components, which I found were the x axis, y axis, left button, right button, and the click on the scroll wheel. I can get click inputs and mouse movements just fine, but I can't figure out how to recieve inputs from the scroll wheel. When I move it around JInput doesn't seem to know in any obvious way. Any ideas?

By the way, the massive debug outputs are gone, and I am also enjoying JInput's simplicity after tooling around with it a bit and figuring out how it works.

See my work:
OTC Software
Offline elias

Senior Member





« Reply #7 - Posted 2006-11-12 18:39:32 »

I think I fixed the mouse scroll wheel issue, try the jinput.jar from here:

http://odense.kollegienet.dk/~naur/jinput.jar

 - elias

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (74 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (44 views)
2014-09-07 01:13:42

Longarmx (28 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!