Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbShiftKey () dose not work with (Z,X,C,V,B,N,M) - buttons. Need help!

Author
Message
AlecG
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 17th Dec 2009 21:24
Hello!
Now I have another problem! In one of my functions the dbShiftKey dose not work with (Z,X,C,V,B,N,M) buttons. How can i solve this problem?


int EnterFontFieldTHR :: read_ascii (void)
{
int scanKey = dbScanCode();

switch (scanKey)
{
case KC_A: if (dbShiftKey()) return ASCII_KEY_A; else return ASCII_KEY_a; break;
case KC_B: if (dbShiftKey()) return ASCII_KEY_B; else return ASCII_KEY_b; break;
case KC_C: if (dbShiftKey()) return ASCII_KEY_C; else return ASCII_KEY_c; break;
case KC_D: if (dbShiftKey()) return ASCII_KEY_D; else return ASCII_KEY_d; break;
case KC_E: if (dbShiftKey()) return ASCII_KEY_E; else return ASCII_KEY_e; break;
case KC_F: if (dbShiftKey()) return ASCII_KEY_F; else return ASCII_KEY_f; break;
case KC_G: if (dbShiftKey()) return ASCII_KEY_G; else return ASCII_KEY_g; break;
case KC_H: if (dbShiftKey()) return ASCII_KEY_H; else return ASCII_KEY_h; break;
case KC_I: if (dbShiftKey()) return ASCII_KEY_I; else return ASCII_KEY_i; break;
case KC_J: if (dbShiftKey()) return ASCII_KEY_G; else return ASCII_KEY_j; break;
case KC_K: if (dbShiftKey()) return ASCII_KEY_K; else return ASCII_KEY_k; break;
case KC_L: if (dbShiftKey()) return ASCII_KEY_L; else return ASCII_KEY_l; break;
case KC_M: if (dbShiftKey()) return ASCII_KEY_M; else return ASCII_KEY_m; break;
case KC_N: if (dbShiftKey()) return ASCII_KEY_N; else return ASCII_KEY_n; break;
case KC_O: if (dbShiftKey()) return ASCII_KEY_O; else return ASCII_KEY_o; break;
case KC_P: if (dbShiftKey()) return ASCII_KEY_P; else return ASCII_KEY_p; break;
case KC_Q: if (dbShiftKey()) return ASCII_KEY_Q; else return ASCII_KEY_q; break;
case KC_R: if (dbShiftKey()) return ASCII_KEY_R; else return ASCII_KEY_r; break;
case KC_S: if (dbShiftKey()) return ASCII_KEY_S; else return ASCII_KEY_s; break;
case KC_T: if (dbShiftKey()) return ASCII_KEY_T; else return ASCII_KEY_t; break;
case KC_U: if (dbShiftKey()) return ASCII_KEY_U; else return ASCII_KEY_u; break;
case KC_V: if (dbShiftKey()) return ASCII_KEY_V; else return ASCII_KEY_v; break;
case KC_W: if (dbShiftKey()) return ASCII_KEY_W; else return ASCII_KEY_w; break;
case KC_X: if (dbShiftKey()) return ASCII_KEY_X; else return ASCII_KEY_x; break;
case KC_Y: if (dbShiftKey()) return ASCII_KEY_Y; else return ASCII_KEY_y; break;
case KC_Z: if (dbShiftKey()) return ASCII_KEY_Z; else return ASCII_KEY_z; break;

case KC_SPACE: return ASCII_KEY_SPACE; break;
case KC_BACKSP: return ASCII_KEY_BACKSP; break;

};//end switch

};

HI!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 18th Dec 2009 09:52
Because shift key has a scancode? Use dbKeyState(). You can also get a list of the values for it via dinput.h from all the macros beginning with DIK_, i.e. DIK_W, DIK_F1, etc.

DARKGDK
15
Years of Service
User Offline
Joined: 23rd Oct 2009
Location:
Posted: 18th Dec 2009 11:26
you have time machine to lose ? ^^
AlecG
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 18th Dec 2009 23:01
dbKeyState() dose not work.






This code is not working with Z,X,C,V,B,N,M butons. Right shift is working fine but left shift dose not work...

HI!
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 19th Dec 2009 10:13
Instead of dbShiftKey use the scancode for left Shift.

Isocadia
AlecG
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 19th Dec 2009 10:54

42 - is the scan code of lift shift button.
KS_A = 30;
KS_Z = 44;

case KC_A: if (dbKeyState (42)) return ASCII_KEY_A; else return ASCII_KEY_a; break;

this is working

case KC_Z: if (dbKeyState (42)) return ASCII_KEY_Z; else return ASCII_KEY_z; break;

this is not




HI!

Login to post a reply

Server time is: 2024-11-20 07:18:37
Your offset time is: 2024-11-20 07:18:37