summaryrefslogtreecommitdiff
authorhash <hash>2002-08-12 07:40:48 (UTC)
committer hash <hash>2002-08-12 07:40:48 (UTC)
commit895a6e1cebade986110758c57cafdadd942a63ff (patch) (unidiff)
tree626a808b4f7ff27e7efd02a0573544fc7c4d04a7
parent063b97e6cde3688f85969d7515ff75044fe02c21 (diff)
downloadopie-895a6e1cebade986110758c57cafdadd942a63ff.zip
opie-895a6e1cebade986110758c57cafdadd942a63ff.tar.gz
opie-895a6e1cebade986110758c57cafdadd942a63ff.tar.bz2
korean support only
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index 3e43978..d0cfa51 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -449,49 +449,50 @@ void Keyboard::clearHighlight()
449 449
450/* Keyboard::sizeHint {{{1 */ 450/* Keyboard::sizeHint {{{1 */
451QSize Keyboard::sizeHint() const 451QSize Keyboard::sizeHint() const
452{ 452{
453 QFontMetrics fm=fontMetrics(); 453 QFontMetrics fm=fontMetrics();
454 int keyHeight = fm.lineSpacing(); 454 int keyHeight = fm.lineSpacing();
455 455
456 return QSize( 240, keyHeight * 5 + (usePicks ? picks->sizeHint().height() : 0) + 1); 456 return QSize( 240, keyHeight * 5 + (usePicks ? picks->sizeHint().height() : 0) + 1);
457} 457}
458 458
459 459
460void Keyboard::resetState() 460void Keyboard::resetState()
461{ 461{
462 schar = mchar = echar = 0; 462 schar = mchar = echar = 0;
463 picks->resetState(); 463 picks->resetState();
464} 464}
465 465
466/* korean input functions {{{1 466/* korean input functions {{{1
467 * 467 *
468 * TODO 468 * TODO
469 * one major problem with this implementation is that you can't move the 469 * one major problem with this implementation is that you can't move the
470 * cursor after inputing korean chars, otherwise it will eat up and replace 470 * cursor after inputing korean chars, otherwise it will eat up and replace
471 * the char before the cursor you move to. fix that 471 * the char before the cursor you move to. fix that
472 * 472 *
473 * make a kor/eng swaping key 473 * make backspace delete one single char, not the whole thing if still
474 * editing.
474 * 475 *
475 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 476 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
476 * 477 *
477 * how korean input works 478 * how korean input works
478 * 479 *
479 * all following chars means unicode char value and are in hex 480 * all following chars means unicode char value and are in hex
480 * 481 *
481 * ÃÊÀ½ = schar (start char) 482 * ÃÊÀ½ = schar (start char)
482 * ÁßÀ½ = mchar (middle char) 483 * ÁßÀ½ = mchar (middle char)
483 * ³¡À½ = echar (end char) 484 * ³¡À½ = echar (end char)
484 * 485 *
485 * there are 19 schars. unicode position is at 1100 - 1112 486 * there are 19 schars. unicode position is at 1100 - 1112
486 * there are 21 mchars. unicode position is at 1161 - 1175 487 * there are 21 mchars. unicode position is at 1161 - 1175
487 * there are 27 echars. unicode position is at 11a8 - 11c2 488 * there are 27 echars. unicode position is at 11a8 - 11c2
488 * 489 *
489 * the map with everything combined is at ac00 - d7a3 490 * the map with everything combined is at ac00 - d7a3
490 * 491 *
491 */ 492 */
492 493
493ushort Keyboard::parseKoreanInput (ushort c) { 494ushort Keyboard::parseKoreanInput (ushort c) {
494 495
495 if ((c != 0 && (c < 0x1100 || 0x11c2 < c) && (c < 0xac00 || 0xd7a3 < c)) 496 if ((c != 0 && (c < 0x1100 || 0x11c2 < c) && (c < 0xac00 || 0xd7a3 < c))
496 || 497 ||
497 (c == 0 && qkeycode != Qt::Key_Shift && Qt::Key_CapsLock != qkeycode 498 (c == 0 && qkeycode != Qt::Key_Shift && Qt::Key_CapsLock != qkeycode
@@ -749,50 +750,49 @@ ushort Keyboard::constoe(const ushort c) {
749 case 0x11b8: return 0x1107; 750 case 0x11b8: return 0x1107;
750 case 0x11ba: return 0x1109; 751 case 0x11ba: return 0x1109;
751 case 0x11bb: return 0x110a; 752 case 0x11bb: return 0x110a;
752 case 0x11bc: return 0x110b; 753 case 0x11bc: return 0x110b;
753 case 0x11bd: return 0x110c; 754 case 0x11bd: return 0x110c;
754 case 0x11be: return 0x110e; 755 case 0x11be: return 0x110e;
755 case 0x11bf: return 0x110f; 756 case 0x11bf: return 0x110f;
756 case 0x11c0: return 0x1110; 757 case 0x11c0: return 0x1110;
757 case 0x11c1: return 0x1111; 758 case 0x11c1: return 0x1111;
758 case 0x11c2: return 0x1112; 759 case 0x11c2: return 0x1112;
759 default: return 0; 760 default: return 0;
760 761
761 } 762 }
762 763
763 } 764 }
764} 765}
765 766
766 767
767// Keys::Keys {{{1 768// Keys::Keys {{{1
768 769
769Keys::Keys() { 770Keys::Keys() {
770 771
771 Config config("locale"); 772 Config config("locale");
772 config.setGroup( "Language" ); 773 config.setGroup( "Language" );
773 QString l = config.readEntry( "Language" ); 774 QString l = config.readEntry( "Language" , "en" );
774 if(l.isEmpty()) l = "en";
775 775
776 QString key_map = QPEApplication::qpeDir() + "/share/multikey/" 776 QString key_map = QPEApplication::qpeDir() + "/share/multikey/"
777 + /* l // testing korean for now */ 777 + /* l // testing korean for now */
778 + "ko.keymap"; 778 + "ko.keymap";
779 779
780 setKeysFromFile(key_map); 780 setKeysFromFile(key_map);
781} 781}
782 782
783Keys::Keys(const char * filename) { 783Keys::Keys(const char * filename) {
784 784
785 setKeysFromFile(filename); 785 setKeysFromFile(filename);
786} 786}
787 787
788// Keys::setKeysFromFile {{{2 788// Keys::setKeysFromFile {{{2
789void Keys::setKeysFromFile(const char * filename) { 789void Keys::setKeysFromFile(const char * filename) {
790 790
791 QFile f(filename); 791 QFile f(filename);
792 792
793 if (f.open(IO_ReadOnly)) { 793 if (f.open(IO_ReadOnly)) {
794 794
795 QTextStream t(&f); 795 QTextStream t(&f);
796 int row; 796 int row;
797 int qcode; 797 int qcode;
798 ushort unicode; 798 ushort unicode;