Wait, how does the national keyboard layout matter? Aren't you using the US layout when writing code?
Norwegian keyboards have a different physical layout meaning different character codes are sent for the same location.
Here's diagrams of the mappings.
https://www.terena.org/activities/multiling/ml-mua/test/kbd-...
And here's usbkbd (note scancodes at the top):
http://lxr.free-electrons.com/source/drivers/hid/usbhid/usbk...
Explanation on scancodes, which map to which keys for different physical boards: http://www.quadibloc.com/comp/scan.htm