Changeset 178:285aa0c31277
- Timestamp:
- 03/02/08 12:12:27
(8 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Fix: utf8 problem in key event
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r158 |
r178 |
|
| 1284 | 1284 | while (index < chars.length) { |
|---|
| 1285 | 1285 | Event event = new Event (); |
|---|
| 1286 | | if (keyEvent !is null && chars.length <= 1) { |
|---|
| | 1286 | //PORTING take care of utf8 |
|---|
| | 1287 | if (keyEvent !is null && chars.codepointCount() <= 1) { |
|---|
| 1287 | 1288 | setKeyState (event, keyEvent); |
|---|
| 1288 | 1289 | } else { |
|---|
| 1289 | 1290 | setInputState (event, state); |
|---|
| 1290 | 1291 | } |
|---|
| 1291 | | event.character = chars [index]; |
|---|
| | 1292 | //PORTING take care of utf8 |
|---|
| | 1293 | int incr; |
|---|
| | 1294 | event.character = firstCodePoint( chars [index..$], incr ); |
|---|
| 1292 | 1295 | sendEvent (type, event); |
|---|
| 1293 | 1296 | |
|---|
| … | … | |
| 1302 | 1305 | return null; |
|---|
| 1303 | 1306 | } |
|---|
| 1304 | | if (event.doit) chars [count++] = chars [index]; |
|---|
| 1305 | | index++; |
|---|
| | 1307 | |
|---|
| | 1308 | //PORTING take care of utf8 |
|---|
| | 1309 | if (event.doit) { |
|---|
| | 1310 | for( int i = 0; i < incr; i++ ){ |
|---|
| | 1311 | chars [count+i] = chars [index+i]; |
|---|
| | 1312 | } |
|---|
| | 1313 | count+=incr; |
|---|
| | 1314 | } |
|---|
| | 1315 | index+=incr; |
|---|
| 1306 | 1316 | } |
|---|
| 1307 | 1317 | if (ptr !is null) OS.gdk_event_free (ptr); |
|---|