Pedals detection

Hi,

I’m developing a multimedia App (not a game) on Windows and/or OS X but I need the use of a pedals. I’m trying to detect them with the controller Input (that seems to be good for joysticks). 

There are only two pedals (is not for cars simulators). Could you send me any sample code or a suggestion of how to do it? 

Thanks!

King Regards,

Josep Alemany

@jalemanyf,

You should be able to get this working on OSX and we (Corona Geek Hangout) will be covering Analog inputs (joysticks, triggers on controller, etc) in future weeks, but we haven’t quite gotten there yet.

Windows however, may not work yet.  I know you can plug in controllers now and get digital inputs (buttons, dpad, etc.) however I’ve had no luck detecting axis events yet.  Now, I could be doing something wrong as I’ve only had a little time on this, but my axis code is working on OSX so I think this is merely not quite supported yet on Windows.

@all,

If anyone else wants to chime and tell me I’m wrong, please do, but elaborate on which version of Corona you’re using if you have had Windows Axis success.   I last tested with 2015.2731

PS - I’ll post back if I make progress against that.

For now, the code I have can be found here ( a work in progress and axis may be commented out for now):

http://github.com/roaminggamer/CoronaGeek/tree/master/Hangouts/ICanMakeThat/DesktopGames

Get ‘deviceInputs.zip’ and look at ‘gamePadJoystick’ (WIP) example.

Back again. **Telling myself I was wrong above**  :slight_smile:

I’m using 2015.2744 and this is detecting the axis events just fine which is awesome.  

I’ll update the example above this week and commit it (probably after the Monday hangout.)

-Ed

@jalemanyf,

You should be able to get this working on OSX and we (Corona Geek Hangout) will be covering Analog inputs (joysticks, triggers on controller, etc) in future weeks, but we haven’t quite gotten there yet.

Windows however, may not work yet.  I know you can plug in controllers now and get digital inputs (buttons, dpad, etc.) however I’ve had no luck detecting axis events yet.  Now, I could be doing something wrong as I’ve only had a little time on this, but my axis code is working on OSX so I think this is merely not quite supported yet on Windows.

@all,

If anyone else wants to chime and tell me I’m wrong, please do, but elaborate on which version of Corona you’re using if you have had Windows Axis success.   I last tested with 2015.2731

PS - I’ll post back if I make progress against that.

For now, the code I have can be found here ( a work in progress and axis may be commented out for now):

http://github.com/roaminggamer/CoronaGeek/tree/master/Hangouts/ICanMakeThat/DesktopGames

Get ‘deviceInputs.zip’ and look at ‘gamePadJoystick’ (WIP) example.

Back again. **Telling myself I was wrong above**  :slight_smile:

I’m using 2015.2744 and this is detecting the axis events just fine which is awesome.  

I’ll update the example above this week and commit it (probably after the Monday hangout.)

-Ed

Hi,

Sorry for the delate.

I have tried to download the zip file but I have no permissions. So I copy all the text files one by one to my computer to test it.

The Corona version is the 2015.2751 (the most similar I have installed).

When I tested it works with the keyboard detection all the keys but the pedals are completely invisible for the mac computer :frowning:

If I test the pedals with the a command in the terminal (ioreg -p IOUSB -w0 | sed ‘s/[^o]*o //; s/@.*$//’ | grep -v ‘^Root.*’) it appears with the name VEC USB Footpedal (the OS X has detected well but no from Corona).

Thanks You,

Josep Alemany

If you simply want to see if key events are being detected run a small app w/ this code and be sure to select an android device for the simulator( all should detect keys on OS X, but on Windows simulator only android simulated devices detect keys):

local function key( event ) for k,v in pairs( event ) do print( k, v ) end print( "\n---------------------------------", system.getTimer()) end Runtime:addEventListener( "key", key )

If you think the pedal is producing axis events try this:

local function axis( event ) for k,v in pairs( event ) do print( k, v ) end print( "\n---------------------------------", system.getTimer()) end Runtime:addEventListener( "axis", axis )

Note: I don’t know what you meant by this. You couldn’t download this file?

http://github.com/roaminggamer/CoronaGeek/raw/master/Hangouts/ICanMakeThat/DesktopGames/deviceInputs.zip

Or, you couldn’t unzip it?

Hi,

Now, I’m doing it with another computer (not the laptop) and it downloads without problem. 

In any case, I ran it on Corona with the same results, the code detects perfectly the keyboard inputs but nothing happens with the anagogic pedals.

Thanks! Any idea?

Sorry no ideas.  I’ll defer to staff to answer of suggest on this.  

You may need an additional driver or software to change the inputs into something Corona can detect.

Do you have a specific manufacturer and model for the pedal?

You should also try all input events: mouse, axis, key, etc.   Who knows if it is’t coming in as some other input style.

-Ed

Hi,

Sorry for the delate.

I have tried to download the zip file but I have no permissions. So I copy all the text files one by one to my computer to test it.

The Corona version is the 2015.2751 (the most similar I have installed).

When I tested it works with the keyboard detection all the keys but the pedals are completely invisible for the mac computer :frowning:

If I test the pedals with the a command in the terminal (ioreg -p IOUSB -w0 | sed ‘s/[^o]*o //; s/@.*$//’ | grep -v ‘^Root.*’) it appears with the name VEC USB Footpedal (the OS X has detected well but no from Corona).

Thanks You,

Josep Alemany

If you simply want to see if key events are being detected run a small app w/ this code and be sure to select an android device for the simulator( all should detect keys on OS X, but on Windows simulator only android simulated devices detect keys):

local function key( event ) for k,v in pairs( event ) do print( k, v ) end print( "\n---------------------------------", system.getTimer()) end Runtime:addEventListener( "key", key )

If you think the pedal is producing axis events try this:

local function axis( event ) for k,v in pairs( event ) do print( k, v ) end print( "\n---------------------------------", system.getTimer()) end Runtime:addEventListener( "axis", axis )

Note: I don’t know what you meant by this. You couldn’t download this file?

http://github.com/roaminggamer/CoronaGeek/raw/master/Hangouts/ICanMakeThat/DesktopGames/deviceInputs.zip

Or, you couldn’t unzip it?

Hi,

Now, I’m doing it with another computer (not the laptop) and it downloads without problem. 

In any case, I ran it on Corona with the same results, the code detects perfectly the keyboard inputs but nothing happens with the anagogic pedals.

Thanks! Any idea?

Sorry no ideas.  I’ll defer to staff to answer of suggest on this.  

You may need an additional driver or software to change the inputs into something Corona can detect.

Do you have a specific manufacturer and model for the pedal?

You should also try all input events: mouse, axis, key, etc.   Who knows if it is’t coming in as some other input style.

-Ed