fix gdi backend bug
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@610 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
06753e97f5
commit
9874b24846
3 changed files with 17 additions and 3 deletions
|
|
@ -130,13 +130,15 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|||
int n = wp;
|
||||
const int base = 'A' - 1;
|
||||
|
||||
if(0x00 <= n && n <= 0x1f) {
|
||||
if(n <= 0x1f) {
|
||||
n = (n + base) | MwLLControlMask;
|
||||
if(!(HIBYTE(VkKeyScan(wp)) & 1)) n += 0x20;
|
||||
if(!(GetKeyState(VK_LSHIFT) || GetKeyState(VK_RSHIFT))) n += 0x20;
|
||||
}
|
||||
if(HIBYTE(VkKeyScan(wp)) & 2) n |= MwLLControlMask;
|
||||
if(msg == WM_SYSCHAR) n |= MwLLAltMask;
|
||||
|
||||
printf("%c\n", n & 0xff);
|
||||
|
||||
if((0x20 <= n && n <= 0x7f) || (n & MwLLKeyMask)) MwLLDispatch(u->ll, key, &n);
|
||||
} else if(msg == WM_SETFOCUS) {
|
||||
MwLLDispatch(u->ll, focus_in, NULL);
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ void MwLLNextEvent(MwLL handle) {
|
|||
if(strlen(str) == 1) {
|
||||
char s = str[0];
|
||||
|
||||
if(ev.xkey.state & (ShiftMask | LockMask)) {
|
||||
if(ev.xkey.state & (ShiftMask | LockMask) && !(ev.xkey.state & (ControlMask | Mod1Mask))) {
|
||||
n = toupper((int)s);
|
||||
} else {
|
||||
n = s;
|
||||
|
|
@ -392,6 +392,17 @@ void MwLLNextEvent(MwLL handle) {
|
|||
n = MwLLKeyLeftShift;
|
||||
} else if(strcmp(str, "Shift_R") == 0) {
|
||||
n = MwLLKeyRightShift;
|
||||
} else if(strcmp(str, "Alt_L") == 0 || strcmp(str, "Alt_R") == 0){
|
||||
n = MwLLKeyAlt;
|
||||
} else if(strcmp(str, "Control_R") == 0 || strcmp(str, "Control_R") == 0){
|
||||
n = MwLLKeyControl;
|
||||
}
|
||||
|
||||
if(n != MwLLKeyControl && ev.xkey.state & ControlMask){
|
||||
n |= MwLLControlMask;
|
||||
}
|
||||
if(n != MwLLKeyAlt && ev.xkey.state & Mod1Mask){
|
||||
n |= MwLLAltMask;
|
||||
}
|
||||
|
||||
if(n != -1) {
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ static void key(MwWidget handle, int code) {
|
|||
t->cursor++;
|
||||
} else if(code == MwLLKeyEnter) {
|
||||
MwDispatchUserHandler(handle, MwNactivateHandler, NULL);
|
||||
} else if(code == (MwLLControlMask | 'v')){
|
||||
} else if(!(code & MwLLKeyMask)) {
|
||||
int incr = 0;
|
||||
out = malloc(strlen(str) + 5 + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue