Hello, i was wondering if it would be possible to assign the power button to an external keyboard or gamepad as i have reshaped my ubuntu thus far to run like a game console because i like the feel of the style and function, all tests on all the software I own prove able to be functional [blender feels like a create your own world game in this environment]
but one thing has constantly eluded me, how to make a external usb controller have one of its buttons for use in place of the power button to do both on/off system function like what a modern console has, any help would be greatly appreciated.

turning it off with a controller would likely be easier than turning the system back on in my opinion

this function would also be use full on a key board

[the irony is keyboard on my laptop broke so i looked at alternatives to it and found out game pads were good replacements in cases that you had no extra keyboards lying around but instead a bunch o dusty ol gamepads lying around. and if you are wonderin about the mouse it blew up PERIOD. due to fun hobby idea of creating a linux console,]