/** * Gets the Latin symbol which corresponds * to some non-Latin symbol on the localized keyboard. * The search is done via lookup of Resource bundle * for pairs having the form (e.g.) <code>MNEMONIC_\u0424=A</code>. * @param localeChar non-Latin character or a punctuator to be used as mnemonic * @return character on latin keyboard, corresponding to the locale character, * or the appropriate VK_*** code (if there's no latin character * "under" the non-Latin one */ private static int getLatinKeycode(char localeChar) throws MissingResourceException { // associated should be a latin character, arabic digit // or an integer (KeyEvent.VK_***) String str = getBundle().getString("MNEMONIC_" + localeChar); // NOI18N if (str.length() == 1) { return str.charAt(0); } else { return Integer.parseInt(str); } }
/** * Gets the Latin symbol which corresponds * to some non-Latin symbol on the localized keyboard. * The search is done via lookup of Resource bundle * for pairs having the form (e.g.) <code>MNEMONIC_\u0424=A</code>. * @param localeChar non-Latin character or a punctuator to be used as mnemonic * @return character on latin keyboard, corresponding to the locale character, * or the appropriate VK_*** code (if there's no latin character * "under" the non-Latin one */ private static int getLatinKeycode(char localeChar) { try { // associated should be a latin character, arabic digit // or an integer (KeyEvent.VK_***) String str=getBundle().getString("MNEMONIC_" + localeChar); // NOI18N if( str.length()==1 ) return str.charAt(0); else return Integer.parseInt(str); } catch (MissingResourceException x) { // correspondence not found, it IS an error, // but we eat it, and return the character itself x.printStackTrace(); return localeChar; } }
/** * Gets the Latin symbol which corresponds * to some non-Latin symbol on the localized keyboard. * The search is done via lookup of Resource bundle * for pairs having the form (e.g.) <code>MNEMONIC_\u0424=A</code>. * @param localeChar non-Latin character or a punctuator to be used as mnemonic * @return character on latin keyboard, corresponding to the locale character, * or the appropriate VK_*** code (if there's no latin character * "under" the non-Latin one */ private static int getLatinKeycode(char localeChar) { try { // associated should be a latin character, arabic digit // or an integer (KeyEvent.VK_***) String str=getBundle().getString("MNEMONIC_" + localeChar); // NOI18N if( str.length()==1 ) return str.charAt(0); else return Integer.parseInt(str); } catch (MissingResourceException x) { // correspondence not found, it IS an error, // but we eat it, and return the character itself x.printStackTrace(); return localeChar; } }