Caps lock dll?
Blitz3D Forums/Blitz3D Programming/Caps lock dll?
| ||
Is there a dll that checks for if capslock is active and stuff like that? |
| ||
Um... say no if you don't know so that I don't try to bump this again :) |
| ||
This should help:;.lib "user32.dll" ;GetKeyState%(key%):"GetKeyState" While Not KeyDown(1) DebugLog GetKeyState($14) Wend End |
| ||
It returns either 0(off) or 1(on) or some other value(being pressed). |
| ||
;- |
| ||
Setkeyboardstate might do the trick. SetKeyboardState%(KeyBoard_Bank*) |
| ||
;- |
| ||
That was a declaration to be added to the "user32.decl" file in the Blitz userlibs folder. Make one if it does not exist and add... .lib "user32.dll" GetKeyboardState%(Keyboard_Bank*) SetKeyboardState%(KeyBoard_Bank*) The bank is just a bank you create in Blitz. I think it is a case of calling getkeyboardstate with the bank as an argument, then pokebyte 1 at the position of the virtual key you want to set according to the constant list below and then call setkeyboardstate with the same bank. A good reference on the functions provided by the API and a particular explanation of the flags used by Getkeystate and so on can be found in the downloadable API reference found at http://www.mentalis.org/agnet/apiguide.shtml I have not used these functions much however so I can not say what (if any) problems there might be when using them with blitz keyboard functions. Note that some of the constants may only work on NT/XP. Global VKB = CreateBank(256) Const VK_LBUTTON = $1 Const VK_RBUTTON = $2 Const VK_CANCEL = $3 Const VK_MBUTTON = $4 Const VK_BACK = $8 Const VK_TAB = $9 Const VK_CLEAR = $C Const VK_RETURN = $D Const VK_SHIFT = $10 Const VK_CONTROL = $11 Const VK_MENU = $12 Const VK_PAUSE = $13 Const VK_CAPITAL = $14 Const VK_ESCAPE = $1B Const VK_SPACE = $20 Const VK_PRIOR = $21 Const VK_NEXT = $22 Const VK_END = $23 Const VK_HOME = $24 Const VK_LEFT = $25 Const VK_UP = $26 Const VK_RIGHT = $27 Const VK_DOWN = $28 Const VK_SELECT = $29 Const VK_PRINT = $2A Const VK_EXECUTE = $2B Const VK_SNAPSHOT = $2C Const VK_INSERT = $2D Const VK_DELETE = $2E Const VK_HELP = $2F Const VK_0 = $30 Const VK_1 = $31 Const VK_2 = $32 Const VK_3 = $33 Const VK_4 = $34 Const VK_5 = $35 Const VK_6 = $36 Const VK_7 = $37 Const VK_8 = $38 Const VK_9 = $39 Const VK_A = $41 Const VK_B = $42 Const VK_C = $43 Const VK_D = $44 Const VK_E = $45 Const VK_F = $46 Const VK_G = $47 Const VK_H = $48 Const VK_I = $49 Const VK_J = $4A Const VK_K = $4B Const VK_L = $4C Const VK_M = $4D Const VK_N = $4E Const VK_O = $4F Const VK_P = $50 Const VK_Q = $51 Const VK_R = $52 Const VK_S = $53 Const VK_T = $54 Const VK_U = $55 Const VK_V = $56 Const VK_W = $57 Const VK_X = $58 Const VK_Y = $59 Const VK_Z = $5A Const VK_STARTKEY = $5B Const VK_STARTKEY2 = $5C ; on my keyboard anyway Const VK_CONTEXTKEY = $5D Const VK_NUMPAD0 = $60 Const VK_NUMPAD1 = $61 Const VK_NUMPAD2 = $62 Const VK_NUMPAD3 = $63 Const VK_NUMPAD4 = $64 Const VK_NUMPAD5 = $65 Const VK_NUMPAD6 = $66 Const VK_NUMPAD7 = $67 Const VK_NUMPAD8 = $68 Const VK_NUMPAD9 = $69 Const VK_MULTIPLY = $6A Const VK_ADD = $6B Const VK_SEPARATOR = $6C Const VK_SUBTRACT = $6D Const VK_DECIMAL = $6E Const VK_DIVIDE = $6F Const VK_F1 = $70 Const VK_F2 = $71 Const VK_F3 = $72 Const VK_F4 = $73 Const VK_F5 = $74 Const VK_F6 = $75 Const VK_F7 = $76 Const VK_F8 = $77 Const VK_F9 = $78 Const VK_F10 = $79 Const VK_F11 = $7A Const VK_F12 = $7B Const VK_F13 = $7C Const VK_F14 = $7D Const VK_F15 = $7E Const VK_F16 = $7F Const VK_F17 = $80 Const VK_F18 = $81 Const VK_F19 = $82 Const VK_F20 = $83 Const VK_F21 = $84 Const VK_F22 = $85 Const VK_F23 = $86 Const VK_F24 = $87 Const VK_NUMLOCK = $90 Const VK_OEM_SCROLL = $91, VK_SCROLL = $91 Const VK_OEM_1 = $BA Const VK_OEM_PLUS = $BB Const VK_OEM_COMMA = $BC Const VK_OEM_MINUS = $BD Const VK_OEM_PERIOD = $BE Const VK_OEM_2 = $BF Const VK_OEM_3 = $C0 Const VK_OEM_4 = $DB Const VK_OEM_5 = $DC Const VK_OEM_6 = $DD Const VK_OEM_7 = $DE Const VK_OEM_8 = $DF Const VK_ICO_F17 = $E0 Const VK_ICO_F18 = $E1 Const VK_OEM_102 = $E2 Const VK_ICO_HELP = $E3 Const VK_ICO_00 = $E4 Const VK_ICO_CLEAR = $E6 Const VK_OEM_RESET = $E9 Const VK_OEM_JUMP = $EA Const VK_OEM_PA1 = $EB Const VK_OEM_PA2 = $EC Const VK_OEM_PA3 = $ED Const VK_OEM_WSCTRL = $EE Const VK_OEM_CUSEL = $EF Const VK_OEM_ATTN = $F0 Const VK_OEM_FINNISH = $F1 Const VK_OEM_COPY = $F2 Const VK_OEM_AUTO = $F3 Const VK_OEM_ENLW = $F4 Const VK_OEM_BACKTAB = $F5 Const VK_ATTN = $F6 Const VK_CRSEL = $F7 Const VK_EXSEL = $F8 Const VK_EREOF = $F9 Const VK_PLAY = $FA Const VK_ZOOM = $FB Const VK_NONAME = $FC Const VK_PA1 = $FD Const VK_OEM_CLEAR = $FE ; Windows NT only Const VK_LSHIFT = $A0 Const VK_RSHIFT = $A1 Const VK_LCONTROL = $A2 Const VK_RCONTROL = $A3 Const VK_LMENU = $A4 Const VK_RMENU = $A5 and here is some data with associated key descriptions which you might find useful. Data VK_LBUTTON, "Left mouse button" Data VK_RBUTTON, "Right mouse button" Data VK_CANCEL,"Cancel virtual key" Data VK_MBUTTON, "Middle mouse button" Data VK_BACK, "Backspace" Data VK_TAB, "Tab" Data VK_CLEAR, "5 (keypad without Num Lock)" Data VK_RETURN, "Enter" Data VK_SHIFT, "Shift (either one)" Data VK_CONTROL, "Ctrl (either one)" Data VK_MENU, "Alt (either one)" Data VK_PAUSE, "Pause" Data VK_CAPITAL, "Caps Lock" Data VK_ESCAPE, "Esc" Data VK_SPACE, "Spacebar" Data VK_PRIOR, "Page Up" Data VK_NEXT, "Page Down" Data VK_END, "End" Data VK_HOME, "Home" Data VK_LEFT, "Left Arrow" Data VK_UP, "Up Arrow" Data VK_RIGHT, "Right Arrow" Data VK_DOWN, "Down Arrow" Data VK_SELECT, "Select" Data VK_PRINT, "Print (only used by Nokia keyboards)" Data VK_EXECUTE, "Execute (not used)" Data VK_SNAPSHOT, "Print Screen" Data VK_INSERT, "Insert" Data VK_DELETE, "Delete" Data VK_HELP, "Help" Data VK_0, "0" Data VK_1, "1" Data VK_2, "2" Data VK_3, "3" Data VK_4, "4" Data VK_5, "5" Data VK_6, "6" Data VK_7, "7" Data VK_8, "8" Data VK_9, "9" Data VK_A, "A" Data VK_B, "B" Data VK_C, "C" Data VK_D, "D" Data VK_E, "E" Data VK_F, "F" Data VK_G, "G" Data VK_H, "H" Data VK_I, "I" Data VK_J, "J" Data VK_K, "K" Data VK_L, "L" Data VK_M, "M" Data VK_N, "N" Data VK_O, "O" Data VK_P, "P" Data VK_Q, "Q" Data VK_R, "R" Data VK_S, "S" Data VK_T, "T" Data VK_U, "U" Data VK_V, "V" Data VK_W, "W" Data VK_X, "X" Data VK_Y, "Y" Data VK_Z, "Z" Data VK_STARTKEY, "Start Menu key" Data VK_STARTKEY2, "Right Start Menu key" Data VK_CONTEXTKEY, "Context Menu key" Data VK_NUMPAD0, "0 (keypad with Num Lock)" Data VK_NUMPAD1, "1 (keypad with Num Lock)" Data VK_NUMPAD2, "2 (keypad with Num Lock)" Data VK_NUMPAD3, "3 (keypad with Num Lock)" Data VK_NUMPAD4, "4 (keypad with Num Lock)" Data VK_NUMPAD5, "5 (keypad with Num Lock)" Data VK_NUMPAD6, "6 (keypad with Num Lock)" Data VK_NUMPAD7, "7 (keypad with Num Lock)" Data VK_NUMPAD8, "8 (keypad with Num Lock)" Data VK_NUMPAD9, "9 (keypad with Num Lock)" Data VK_MULTIPLY, "* (keypad)" Data VK_ADD, "+ (keypad)" Data VK_SEPARATOR, "Separator (never generated by the keyboard)" Data VK_DECIMAL, ". (keypad with Num Lock)" Data VK_DIVIDE, "/ (keypad)" Data VK_F1, "F1" Data VK_F2, "F2" Data VK_F3, "F3" Data VK_F4, "F4" Data VK_F5, "F5" Data VK_F6, "F6" Data VK_F7, "F7" Data VK_F8, "F8" Data VK_F9, "F9" Data VK_F10, "F10" Data VK_F11, "F11" Data VK_F12, "F12" Data VK_F13, "F13" Data VK_F14, "F14" Data VK_F15, "F15" Data VK_F16, "F16" Data VK_F17, "F17" Data VK_F18, "F18" Data VK_F19, "F19" Data VK_F20, "F20" Data VK_F21, "F21" Data VK_F22, "F22" Data VK_F23, "F23" Data VK_F24, "F24" Data VK_NUMLOCK, "Num Lock" Data VK_OEM_SCROLL, "Scroll Lock" Data VK_OEM_1, ";" Data VK_OEM_PLUS, "=" Data VK_OEM_COMMA, "," Data VK_OEM_MINUS, "-" Data VK_OEM_PERIOD, "." Data VK_OEM_2, "/" Data VK_OEM_3, "`" Data VK_OEM_4, "[" Data VK_OEM_5, "\" Data VK_OEM_6, "]" Data VK_OEM_7, "'" Data VK_OEM_8, "(unknown)" Data VK_ICO_F17, "F17 on Olivetti extended keyboard (internal use only)" Data VK_ICO_F18, "F18 on Olivetti extended keyboard (internal use only)" Data VK_OEM_102, "< or | on IBM-compatible 102 enhanced non-U.S. keyboard" Data VK_ICO_HELP, "Help on Olivetti extended keyboard (internal use only)" Data VK_ICO_00, "00 on Olivetti extended keyboard (internal use only)" Data VK_ICO_CLEAR, "Clear on Olivette extended keyboard (internal use only)" Data VK_OEM_RESET, "Reset (Nokia keyboards only)" Data VK_OEM_JUMP, "Jump (Nokia keyboards only)" Data VK_OEM_PA1, "PA1 (Nokia keyboards only)" Data VK_OEM_PA2, "PA2 (Nokia keyboards only)" Data VK_OEM_PA3, "PA3 (Nokia keyboards only)" Data VK_OEM_WSCTRL, "WSCTRL (Nokia keyboards only)" Data VK_OEM_CUSEL, "CUSEL (Nokia keyboards only)" Data VK_OEM_ATTN, "ATTN (Nokia keyboards only)" Data VK_OEM_FINNISH, "FINNISH (Nokia keyboards only)" Data VK_OEM_COPY, "COPY (Nokia keyboards only)" Data VK_OEM_AUTO, "AUTO (Nokia keyboards only)" Data VK_OEM_ENLW, "ENLW (Nokia keyboards only)" Data VK_OEM_BACKTAB, "BACKTAB (Nokia keyboards only)" Data VK_ATTN, "ATTN" Data VK_CRSEL, "CRSEL" Data VK_EXSEL, "EXSEL" Data VK_EREOF, "EREOF" Data VK_PLAY, "PLAY" Data VK_ZOOM, "ZOOM" Data VK_NONAME, "NONAME" Data VK_PA1, "PA1" Data VK_OEM_CLEAR, "CLEAR" ; Windows NT only Data VK_LSHIFT, "The Left Shift key" Data VK_RSHIFT,"The Right Shift key" Data VK_LCONTROL, "The Left Ctrl key" Data VK_RCONTROL, "The Right Ctrl key" Data VK_LMENU, "The Left Alt key" Data VK_RMENU, "The Right Alt key" Data -1,"" |
| ||
This is good, thanks! Now to dissect blitzui again... |