linux - JAVA Robot to type Norwegian characters -


i want type letters å,ø,æ using java awt robot. unable find keyevents these letters. using ubuntu , norwegian selected language. can type these letters keyboard when try keycode these given 0.

can suggest how can write using java robot.

based on solution of wolfgang steiner:

public static void pressunicode(robot r, int key_code) {     r.keypress(keyevent.vk_alt);      for(int = 3; >= 0; --i)     {         // extracts single decade of key-code , adds         // offset required vk_numpad key-code         int numpad_kc = key_code / (int) (math.pow(10, i)) % 10 + keyevent.vk_numpad0;          r.keypress(numpad_kc);         r.keyrelease(numpad_kc);     }      r.keyrelease(keyevent.vk_alt); } 

this automatically goes through each decade of unicode key-code, maps corresponding vk_numpad equivalent , presses/releases keys accordingly. works every unicode character.

to code of symbol following:

char ch='ä'; int key_code = ch; system.out.println(key_code); 

edit: solution windows-based. make work linux try following:

"for linux - hold down 'ctrl' & 'shift' entire time while entering character. while holding them down, press 'u' 4 digit octal code character. "

in detail: https://pthree.org/2006/11/30/its-unicode-baby/


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -