logga


3 inputfields and transparency in firefox for windows

There are alot of bugs related to wmode= transparancy or opaque for firefox in windows, in linux it doesn’t seems to work at all. This particular bug is that you can’t write @ on a swedish keyboard in input textfields. Normaly you write @ with Alt Gr+2, but if you try a normal 2 is written. Faults happends for most Alt Gr codes as £${[]}. A quick workaround is to use the english Shift+2 but most people don’t know that. Or you can paste it in from elsewhere. Another workaround a friend of mine gave me is to pretype the @ in the textfield and let the user write his email around it. There are some other workarounds, but none of them was nice enough.

without the fix

with the fix

My solution registers a keyListener if a textfield is Selected and stores the key-code sequences in a keybuffer. If 17, 18, 50 is pressed an @ is written instead of the 2. 17, 18 is for Alt Gr and 50 is for the 2 key. Other key-code sequences are mapped to other signs. If another textfield or something else is in focus the listeners are removed. The class might need some localisation changes to work on different keyboard layouts.

The class has a very simple setup.

InputFix.initialize();

Once initialized it works on all textfields in the application. One important thing is that you have to import the font for the numbers even if you not is going to use them. It the chars are missing the onChanged event on the textfield are not executed.

A preferred solution is to send the browser as a flashvars and only initialize it for firefox for windows.

source: text, package

3 Comments to “inputfields and transparency in firefox for windows”
  1. G-Man, on May 4th, 2008 at 21:44:55, said:

    Woot! Hoping this works. This was a hard bug to find a solution for!

    Thanks!

    BTW, your blog is AMAZINGLY HARD to read!!! That grey and red on black - ugh!!!

    Other than that I like what ya got here tho :)

    G-Man

  2. G-Man, on May 4th, 2008 at 23:28:58, said:

    Hmmm…call me a flex n00b but how do I get this into my project? I tried include but it’s saying I can’t nest classes…

    G-Man

  3. admin, on May 4th, 2008 at 23:58:39, said:

    I have not seen any faults about nest classes. It’s for actionscript 2 projects and not flex. I added the source in a package above so you don’t have to create the package structure. Place the package in the source folder and then
    import se.superkrut.util.InputFix;
    and run for example
    InputFix.initialize(”sv”);
    for swedish in some kind of init method or in the first frame for framebased projects.

    Intresting about the problems about reading the blog. I havn’t noticed any problems on the different screens I have used. I might look into it.

Comment on this post below


You can leave a response, or trackback from your own site.