Ok, the magic number list is only the fallback default and is British keyboard (`"` and £ not `@` and `#`). The code you pointed to is a good try and probably good enough for most cases, but it does assume that the digits are level 0 and shift is level 1, which may not be the case on all keyboards, but probably few enough it won't be a problem very often.