Skip to content

Commit

Permalink
fixed crash bugs that is inputting accent on hardware keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajit committed Sep 6, 2011
1 parent 62bdbd5 commit 6cf9911
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/jp/tadnak25/openwnn4t/OpenWnnJAJP.java
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,11 @@ private boolean processKeyEvent(KeyEvent ev) {
/* keys which produce a glyph */
if (ev.isPrintingKey()) {
/* do nothing if the character is not able to display or the character is dead key */
if ((mHardShift > 0 && mHardAlt > 0) ||
(ev.isAltPressed() && ev.isShiftPressed())) {
int charCode = ev.getUnicodeChar(MetaKeyKeyListener.META_SHIFT_ON | MetaKeyKeyListener.META_ALT_ON);
if ((mHardShift > 0 || mHardAlt > 0) ||
(ev.isAltPressed() || ev.isShiftPressed())) {
int metaShift = (mHardShift > 0 || ev.isShiftPressed())? MetaKeyKeyListener.META_SHIFT_ON: 0;
int metaAlt = (mHardAlt > 0 || ev.isAltPressed())? MetaKeyKeyListener.META_ALT_ON: 0;
int charCode = ev.getUnicodeChar(metaShift | metaAlt);
if (charCode == 0 || (charCode & KeyCharacterMap.COMBINING_ACCENT) != 0 || charCode == PRIVATE_AREA_CODE) {
if(mHardShift == 1){
mShiftPressing = false;
Expand Down

0 comments on commit 6cf9911

Please sign in to comment.