public KeyMap() {
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new InputStreamReader(getClass()
                    .getResourceAsStream("KeyMap.properties")));
            String line;
            while ((line = reader.readLine()) != null) {
                line = line.trim();
                if (line.length() == 0 || line.startsWith("#")) {
                    continue;
                }
                int index = line.indexOf("=0x");
                if (index == -1) {
                    throw new IOException("malformed line: " + line);
                }
                String keycode_str = line.substring(0, index);
                int keycode = KeyEvent.class.getField(keycode_str).getInt(null);
                int keysym = Integer.parseInt(line.substring(index + 3), 16);
                if (map_.containsKey(keycode)) {
                    throw new IOException("Duplicate entry " + line);
                }
                map_.put(keycode, keysym);
            }
        } catch (Throwable t) {
            logger.log(Level.WARNING, t.getMessage(), t);
        }
    }