Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.78k stars 723 forks source link

Greek combinations #490

Closed litsios closed 7 years ago

litsios commented 8 years ago

Hello,

I want "'" + "α" to give me "ά". So I use

$.keyboard.comboRegex = /([`\'~^\"ao])([α-ω])/gim;

and at the combos variables I pass

combos: {
    "'": { "α": '\u00e6' }
}

However it seems that it's not recognizing. Is it a bug or is there anything wrong at my code?

Mottie commented 8 years ago

Hi @litsios!

Sorry for the long delay in responding. I was on a much needed extended vacation.

The combo regex should include the original latin characters and the alpha - unless you want to include the other greek characters through omega (demo).

// use $.keyboard.language.gr.comboRegex if you're
// using the greek language settings
$.keyboard.language.en.comboRegex = /([`\'~\^\"ao])([a-zα])/mig;

And the combos should also be added, as you have already done (the unicode value matches ά).

combos: {
  "'": {
    "α": "\u03ac"
  }
}
Mottie commented 7 years ago

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.