On Sun, Dec 08, 2002 at 08:01:20PM +0100, Kornel Benko wrote:
> So, next patch attached.
- text_ = ev->text();
+ {
+ QString s = ev->text();
+ lyxerr[Debug::KEY] << " unicode of key is";
+ for (int i = 0; i < s.length(); ++i) {
+ QChar const a = s.ref(i);
+ lyxerr[Debug::KEY] << " " << int(a);
+ }
+ if (!s.isEmpty()) {
+ lyxerr[Debug::KEY] << " ascii == " << ev->ascii();
+ }
+ lyxerr[Debug::KEY] << endl;
Just for debugging ...
+ if ((s.length() == 1) && ( key_ == Qt::Key_unknown)) {
So, if it's one key long but unknown, then :
+ if ((int) s.ref(0) == 0) {
if the first char is 0 ? Are you saying that zcaron keypress returns a Qt_unknown
key *and* the ev->text() is useless ??? That would be a serious bug. What is
your locale set to ??
+ s = ev->ascii();
use ascii ?
+ key_ = 0;
+ }
+ }
+ text_ = s;
I do not understand this at all. First, why are you checking for Key_unknown ? Second,
what is the meaning of the check against 0 ?
This seems to just be a side-consequence of what happens when you call ->ascii()
on a character outside of 7-bit ASCII. It does not seem reliable or sensible. What
we really need is to convert the unicode QChar in getISOEncoded() to the
correctly-encoded 8-bit value. So we need logic to do that.
If you ask, I'm sure someone here can tell you what you need to do (something
with Encoding class I think) ...
regards
john
--
"i am sorey I cant reads yuor emale because my emale box has filtar on it
whitch says, "NO EMALES FROM PEOAPAL UNDER IQ OF 1"
- jeffk