I have the same problem on my AW15R3 and solved it
first install the following packages on ubuntu
sudo apt install ghc libusb-1.0-0-dev cabal-install git pkg-config python-usb -y
then get the scan code of each key from the following command:
dmesg | grep -i code
for example when I press the macro key 4 the following message is printed that indicate the scancode is e015
[ 1737.342249] atkbd serio0: Unknown key released (translated set 2, code 0x95 on isa0060/serio0).
Now the "e015" is the scan code and you need to map that to a free keycode in the system. This could happen by running sudo setkeycodes e011 204
so create a script under /etc/init.d to map the scan codes to a free keycodes available for all keys.
Please note that you need to execute the below commands on Linux console not on the x-server (Ctrl+Shift+F3 to switch to Linux console from X). Use sudo vim /etc/init.d/keyremap and
map the codes to the keycodes:
sudo setkeycodes e011 146
sudo setkeycodes e012 148
sudo setkeycodes e013 149
sudo setkeycodes e014 203
sudo setkeycodes e015 204
sudo setkeycodes e016 184
Then make the script executable by chmod +x keyremap
Finally use xmodmap utility to map the keycodes to keysym so your Xorg can understand and catch the key events using vim ~/.Xmodmap:
keycode 154 = XF86Launch0
keycode 156 = XF86Launch1
keycode 157 = XF86Launch2
keycode 211 = XF86Launch3
keycode 212 = XF86Launch4
keycode 172 = XF86Launch5
Then run sudo xmodmap ~/.Xmodmap
Now you can map the XF86Launchx to any action by using the keyboard shortcuts:

You can create an entry in rc.local so these scripts are executed automatically when machine boot up.