@roaminggamer, I’ve got good news and bad news.
Your app doesn’t work on macOS with a wired Playstation 3 controller. Both of my PS4 controllers are connected to my Playstation and I don’t want to have to break the bluetooth connection and have to set it back up. But with my PS3 controller is wired to my USB port and bluetooth connected.
The good news, your app gets key and axis events. The bad news, is your key names are not correct for Playstation controllers. What you have are names for Xbox controllers. For the game I’ve been working on for what seems to be a couple of years, here is how I map the keys:
local controllerKeys = {} controllerKeys["Sony PLAYSTATION(R)3 Controller"] = {} controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button1"] = "select" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button2"] = "buttonL3" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button3"] = "buttonR3" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button4"] = "start" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button5"] = "up" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button6"] = "right" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button7"] = "down" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button8"] = "left" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button9"] = "buttonL2" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button10"] = "buttonR2" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button11"] = "buttonL1" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button12"] = "buttonR1" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button13"] = "buttonY" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button14"] = "buttonB" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button15"] = "buttonA" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button16"] = "buttonX" controllerKeys["Sony PLAYSTATION(R)3 Controller"]["button17"] = "power" controllerKeys["Sony Computer Entertainment Wireless Controller"] = {} controllerKeys["Sony Computer Entertainment Wireless Controller"]["button1"] = "buttonX" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button2"] = "buttonA" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button3"] = "buttonB" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button4"] = "buttonY" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button5"] = "buttonL1" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button6"] = "buttonR1" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button7"] = "buttonL2" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button8"] = "buttonR2" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button9"] = "select" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button10"] = "start" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button11"] = "buttonL3" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button12"] = "buttonR3" controllerKeys["Sony Computer Entertainment Wireless Controller"]["button13"] = "power" controllerKeys["Xbox"] = {} controllerKeys["Xbox"]["button1"] = "buttonA" controllerKeys["Xbox"]["button2"] = "buttonB" controllerKeys["Xbox"]["button3"] = "buttonX" controllerKeys["Xbox"]["button4"] = "buttonY" controllerKeys["Xbox"]["button5"] = "buttonL1" controllerKeys["Xbox"]["button6"] = "buttonR1" controllerKeys["Xbox"]["button7"] = "buttonL3" controllerKeys["Xbox"]["button8"] = "buttonR3" controllerKeys["Xbox"]["button9"] = "start" controllerKeys["Xbox"]["button10"] = "select" controllerKeys["Xbox"]["button11"] = "power" controllerKeys["Xbox"]["button12"] = "up" controllerKeys["Xbox"]["button13"] = "down" controllerKeys["Xbox"]["button14"] = "left" controllerKeys["Xbox"]["button15"] = "right"
You can see I clearly haven’t tested much with a PS4 controller since I don’t have the up/down/left/right buttons defined, but on my PS3 controller, Corona sees “button7” when I press the “down” button. For an Xbox controller, “down” is “button13”. I don’t believe macOS does any attempt at mapping hardware buttons to logical buttons.
I enabled your table.print_r() statement for the key events to verify this. I also did this for axis events but my sticks are very noisy and generates way too many events. But here is a copy/paste from my Corona console log.
Jan 14 05:58:02.689 table: 0x6000039ed200 { [normalizedValue] =\> -0.011764705181122 Jan 14 05:58:02.690 [name] =\> "axis" [device] =\> userdata: 0x60000222a518 [rawValue] =\> 126 [axis] =\> table: 0x6000039ed200 { [number] =\> 2 [type] =\> "y" [minValue] =\> 0 [maxValue] =\> 255 [accuracy] =\> 0 [descriptor] =\> "Joystick 2: Axis 2" } } table: 0x600003985000 { [normalizedValue] =\> -0.011764705181122 [name] =\> "axis" [device] =\> userdata: 0x60000222a518 [rawValue] =\> 126 [axis] =\> table: 0x600003985000 { [number] =\> 4 [type] =\> "rotationZ" [minValue] =\> 0 [maxValue] =\> 255 [accuracy] =\> 0 [descriptor] =\> "Joystick 2: Axis 4" } } Jan 14 05:58:02.714 table: 0x600003933680 { [normalizedValue] =\> -0.019607841968536 [name] =\> "axis" [device] =\> userdata: 0x60000222a518 [rawValue] =\> 125 Jan 14 05:58:02.714 [axis] =\> table: 0x600003933680 { [number] =\> 4 [type] =\> "rotationZ" [minValue] =\> 0 [maxValue] =\> 255 [accuracy] =\> 0 [descriptor] =\> "Joystick 2: Axis 4" } } Jan 14 05:58:02.748 table: 0x600003937200 { Jan 14 05:58:02.749 [normalizedValue] =\> -0.019607841968536 [name] =\> "axis" [device] =\> userdata: 0x60000222a518 [rawValue] =\> 125 [axis] =\> table: 0x600003937200 { [number] =\> 2 [type] =\> "y" [minValue] =\> 0 [maxValue] =\> 255 [accuracy] =\> 0 [descriptor] =\> "Joystick 2: Axis 2" } }
Corona is receiving the events, but I suspect it’s a mapping problem.
The other issue, and this may be a Corona bug, is when you hide the mouse cursor, it hides it when the mouse is out of the window as long as the simulator is the foreground app.
I guess I’m going to need to sync one of these PS4 controllers after all and get my up/down/left/right buttons mapped 
Rob