Pooya

(Persian Javascript)


Persian Keyboard Emulation with Javascript
[ About | Sample | Changes | Download | Discussion ]


About

Persian/Farsi keyboard emulation under IE/Mozilla/Firefox browsers using Javascript. This code is originally an implementation of National Iranian Keyboard Standard (ISIRI 2901:1994) from Roozbeh Pournader and Behdad Esfahbod but I made some changes to make it work under Firefox/Mozilla browsers too.
It is known to work under Internet Explorer 6.0 in Microsoft Windows and Mozilla and Firefox browsers in any Unicode supporting OS. This code is licensed under GNU General Public License.

Please report comments and bugs to info at_pooyak.com.


Sample usage

Try typing in the following textbox. CTRL+ALT changes language and SHIFT+SPACE inserts a Zero-Width-Non-Joiner character:

Persian / English
Click here for more info.


Changes

Update (2006-04-13): initKeyEvent is back in Firefox 1.5.0.2 (Bug #303713).

Update (2005-12-02): I fixed vertical and horizontal scrolling in Firefox=>1.0.6. Although still horizontal scrolling has some small issues it works fine in most of the cases.

Update (2005-09-09): Thanks to Behdad and Artyom Lukanin the script is now working in Firefox => 1.0.6 too.

Update (2005-08-07): Seems like because of a vulnerability initkeyevent is disabled from Firefox 1.0.6 as you can see in bug #289940. I'm too busy but I will try to write a complete description and comment on that bug hoping that this feature returns back to Firefox.

Firefox on Windows up to version 1.0.x has problem with catching CTRL+ALT event. This problem is fixed in the nightly builds coming with Gecko 1.8b. Knowing that it will be fixed in the next Firefox release (1.1.x). I decided to leave the same key combination, because it is the best possible combination possible. You can change the source code to add extra shortcuts.

Download

 - isiri2901.zip Package: JS Source with a sample HTML
 - isiri2901.js Javascript only

Other files / Old code

Original code was published on Persian Digital Library and FarsiTools project on SourceForge.

 - Iranian Keyboard Layout based on National Iranian Keyboard Standard (ISIRI 2901:1994).


Discussion

Here you can ask your questions and leave your comments about this scripts.

[Click! It's fun. Or try it on the test page.]

Persian keyboard [Hide]

Salam Pooya, 

I was wondering if you know of any javascript code that would produce a persian keyboard. Some people were complaining that they either can't type using persian keyboard or don't have it at work. 

Best,
mehdi

Persian keyboard [Hide]

Hi Mehdi,

I guess you mean a keyboard image that people can look at or type by clicking on it, is that right? There's this Behdad editor http://behdad.org/editor/ which uses this javascript code for the keypresses. There you can find the keyboard images. Knowing Behdad, I'm guessing that those images are GPL'ed as well. We can confirm it with him. 

But still that's not a clickable keyboard. But it shouldn't be that hard to implement. I look into it if you think it is needed.

Persian keyboard [Hide]

salam pooya jan
man ye site mp3 daram ke addressesh ro vared kardam www.mp3-ir.com agar beri tooie site mibini ke paeene page man ye ghesmate news gozashtam age bekham tiooie in farsi benevisam bayad chikar konam? chon vaghty ke az windows baraye in kar estefade mikonam aski code rad mishe

Persian keyboard [Hide]

I saw Behdad's after I saw your javascript.

Your draft keyboard looks promising. My knowledge of javascript is not that good. It would be great if you can drop the letters in a box. 

Best,
mehdi

Persian keyboard [Hide]

Yes, me and Behdad decided to implement this and add it to javascript code. And referesh the page, cause i'm working on it right now.

Persian keyboard [Hide]

I am trying to change the language of three text boxes that I have in Submit page of balatarin. The don't have the same ID but I can give them the same Class. How can I use your code to convert all boxes with the same class? Is there a more elegant solution for it?

thanks,

FF2.0 compatible [Hide]

I'm very happy to see it works all fine in Firefox 2.0 :-)

Great work! [Hide]

Nicely done. Looking for more great works like this one. It is cool to see folks like you guys come up with solution like this...

type farsi [Hide]

salam 
man dombale yek barname migardam ke az tarighe oon betoonam farsi type konam va nemidoonam che barmaei ro bayad search konam lotfan mano rahnamai konid

P [Hide]

harf-e 'پ'- 'p <== farsi' moshkel darad

hkazemi | 2007-08-18 06:35:31 |

P [Hide]

No, that's not true. You probably try to press the "\" button to get "پ" similar to Microsoft Windows. But in the ISIRI 2901:1994 which is the Iran's standard layout you should press "M" to get "پ".

FireFox Error [Hide]

Ba Salam
با سلام
این ادیتور فارسی شما در مرورگر فایرفاکس درست کار نمی کند لطفا راهنمایی کنید.
ضروری است.
با تشکر از زحماتتان
Your Farsi editor does not work properly in FireFox Browser?
Please Help

Typing farsi on buttons [Hide]

Hi!
I am trying to make some buttons with farsi language. I manage to write it but when i want to see the button in different browsers, then the text changes to ?????. Could you please guide me about that if you know about typing farsi in flase, dreamweawer or other tools.
with regards
Ebi

It doesn't type "Peh" [Hide]

Hi

This keyboard doesn't type "Peh" پ of persian alphabet

theone2003a | 2008-01-12 09:22:38 |

It doesn't type "Peh" [Hide]

It does. It is under "M" which is the Iranian standard. See the layout here: http://pooyak.com/p/persianjavascript/keyboard/

Thank and more suggest [Hide]

look at this:
http://sourceforge.net/projects/jsvk/

improve this code with GUI with Javascript, it's so usefull.

thank and goodluck.
\m/

tashakor [Hide]

با تشکر موفق باشید
86/12/6

Hossein | 2008-02-24 23:34:56 |

linux [Hide]

با سلام و تشکر از امکان خوبی که ارائه کرده اید من این کد را استفاده کردم و براحتی در محیط سیستم عامل ویندوز مایکروسافت در تمام مرورگرها کار میکند ولی امروز متوجه شدم در سیستم عامل لینوکس کیبرد هیچ تایپی انجام نمیدهد لطفا راهنمائی کنید

hossein | 2008-04-20 02:32:02 |
[Tuesday 01-06-2009  03:11] [Updated Wednesday 01-16-2008  21:40]