Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Single player mini Bartop -EA Sports NHL 94 Theme. Powered by Raspberry Pi2.  (Read 39296 times)

0 Members and 1 Guest are viewing this topic.

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!


Awesome news on the Xin-Mo.

I like the latest side art background better than the cracked ice look also.

Thanks for the input.

Now for my likely pathetic and confusing tutorial on how I got to where I'm at right now.

1) Root the OUYA. - This allows you to get into the system files where the keylayout files are stored (system/usr/keylayout).  You can create a new keylayout file on your windows computer and transfer it to your ouya via USB.  I'll get to this later.   At this time you should install a file manager on your OUYA like ES file manager.  You will need this to copy keylayout files back and forth between the OUYA and PC.

At one time there was actually an app (One click root) that you could sideload and you could literally root your machine with one click.  With the recent OUYA upgrades unfortunately this doesn't work anymore.  I used "Ouya toolbox".  When you are looking how to install this please note that it's a little trickier to install OUYA drivers on Windows 8.1.

2) Install keytest on your ouya. - What this does is records a scancode from your input device.  By default this scancode is given a output in a generic or assigned keylayout file.  For example in this picture



A button on the input device (lets say its the letter "a" on your keyboard) has a scancode of 116.  In the keylayout file the scancode 116 is assigned to [Power]  The [Action_Down] I assume is when the key is pressed down..  If you wanted to change what the letter "a" on your keyboard does you would edit your keylayout file to change what scancode 116 does.

I got confused with the keycodes and the scancodes.  The keycodes are soft and the scancodes are hard.  Basically what that means is that the letter "a" on your keyboard will always give the same scancode.  The keycode is just a number that goes along with the action code.  For example [Action_Down] will always give a keycode of 26 no matter what keyboard button that action is assigned to.

Cliffs: Ignore keycodes.  They are what they are.

Now you will take your input device (XIN-MO for example) and record all of the scancodes for all of the inputs.  Here were my results, along with the default assigned keycodes.  I have also included a diagram with the action assignments for all the control inputs.



Continued in next post...
« Last Edit: December 19, 2014, 04:30:09 pm by Frank Drebin »

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!
3) Build your keylayout file.

Now I've read different things on this, but I did read somewhere that you cannot create/edit a keylayout file in notepad.  It was suggested to use PSPad (Free)
When you use PS pad there is a selection on the bottom that can be toggled between "DOS", "UNIX", and "MAC".  Make sure it is selected to UNIX when editing and saving.

A keylayout file is basically a file that looks like this:

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Generic key layout file for full alphabetic US English PC style external keyboards.
#
# This file is intentionally very generic and is intended to support a broad rang of keyboards.
# Do not edit the generic key layout to support a specific keyboard; instead, create
# a new key layout file with the required keyboard configuration.
#

key 1     ESCAPE
key 2     1
key 3     2
key 4     3
key 5     4
key 6     5
key 7     6
key 8     7
key 9     8
key 10    9
key 11    0
key 12    MINUS
key 13    EQUALS
key 14    DEL
key 15    TAB
key 16    Q
key 17    W
key 18    E
key 19    R
key 20    T
key 21    Y
key 22    U
key 23    I
key 24    O
key 25    P
....


Etc.  all the way to the 400's.

So that is where you take your scancodes from your input device and assign them outputs to your ouya.

For example, at the bottom right corner of my XIN-MO I have scancode 288.  If I wanted that to be the L2 button, I would write in the keytest file

key 288   Button_R2

And so on.  You only need the scancode inputs that your device has, for example the XIN MO only has inputs from ~280-320 so the ones from 1-280 and from 320 + can be deleted from the keylayout file.

One thing I noticed is that I had some inputs on the XIN-MO that did not have scancodes but had keycodes, (19,20,21,22)  These are the default D pad inputs (U,D,L,R)and cannot be reassigned.  Don't ask why.  I think it has something with them being analog inputs?

Once you have your keylayout file built you need to save it with a device specific name.

The default naming scheme is:

Vendor_XXXX_Product_XXXX.kl

Now to find the vendor and product ID:

Go to "view devices and printers" in My computer. > Right click on your input device > properties > hardware > properties > details > now select : "hardware lds"

You will be given a list that should look like this:

HID\VID_16C0&PID_05E1&REV_0100&Col02

HID\VID_16C0&PID_05E1&Col02

HID_DEVICE_SYSTEM_GAME

HID_DEVICE_UP:0001_U:0004

HID_DEVICE

The red is your vendor ID and the green is your product ID.  So your keylayout will be saved as : Vendor_16c0_Product_05e1.kl

Capitals are important!  Adam sent me a file that was labled with a .KL and the capital letters on the extension prevented it from working.

Now drag this file to your keylayout file in your OUYA, restart and it should be good to go. 

AzureKnight

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 474
  • Last login:May 29, 2022, 12:22:17 am

On the art, I like that background a lot better.

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!

On the art, I like that background a lot better.
Its so much nicer and true to the game isn't it?

This is pretty much the final draft with the location of the trigger buttons mapped.  The blue dot will of course be removed prior to printing.

Any experts that can help me order from souldraw with measurements?


Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!
Ok got my buttons from GGG today.  Little problem.  The buttons with the switches are a little too long and don't fit where the joystick is.

Is there such a thing as buttons with integrated switches like the ones  I got from Ebay?  Be$$ides these ones from Happ?

http://na.suzohapp.com/all_catalogs/pushbuttons/RBM-730S-F66
Would hate to not be able to use the chromalite buttons all around.  They look so damn good.


Little bit of progress pics:

Where the OUYA will be mounted (under the CP)

Speakers wired up and mounted (just hot glue)





Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!
Well ordered the Seismitsu PS-14-KN in clear for the 4 front admin buttons and the two side trigger buttons.  Should be a nice compromise and maybe even look better than the chromalite, if I can use the blue ice on the inside.



Budget?

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!
Should be here in a week or 2!
« Reply #86 on: February 03, 2015, 08:22:40 pm »

ChanceKJ

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3229
  • Last login:August 07, 2021, 02:52:06 pm
Das pretty.  :D

I like how the whole thing looks like ice. Clever.

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!


Ordered some of this for the marquee retainer: - 1/2" chrome outside corner molding



http://www.amazon.ca/dp/B001C7NE26/ref=pe_386430_126088100_TE_item

bfauska

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1372
  • Last login:April 15, 2025, 10:49:31 pm
  • "You're not wrong Walter, you're just an @##hole!"
Looking good but you should probably add a joystick.  :laugh2:

That chrome moulding for the marquee should go really well with the chrome t-moulding.

05SRT4

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1092
  • Last login:July 04, 2025, 09:00:05 am
  • Check out my Pow Pow
Looks awesome, I also dig the couple making out in the corner!!

Quick question about the buttons near the speakers, are those always lit? Do they add any glare to the pexi-glass.

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!
Looks awesome, I also dig the couple making out in the corner!!

Quick question about the buttons near the speakers, are those always lit? Do they add any glare to the pexi-glass.

Not going to light them for that very reason.  They just looked better than the standard white buttons.  They are for volume control.

ChanceKJ

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3229
  • Last login:August 07, 2021, 02:52:06 pm
It's hard to make chrome T-Moulding look anything but tacky. Good job! :D

Frank Drebin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 263
  • Last login:January 11, 2022, 04:27:19 pm
  • I want to build my own arcade controls!
OK outside is done, and quite frankly, the OUYA is not worth the effort to try and get it working with the nostalgia front end.  I grabbed a PI2 and will run retropie instead.

Anyways, some pics: