Menu

#197 support for GetKeyboardState

Unscheduled
closed
nobody
None
Feature
1
2021-10-18
2021-02-20
No

I would love support (even just basic without any helper, just an array or list result for) GetKeyboardState

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getkeyboardstate

(would avoid having to do GetAsyncKeyState dozens of times)
Thanks!

Discussion

  • Ashok P. Nadkarni

    You can now use the cffi package for this. See https://cffi.magicsplat.com. Sample is below:

    % package require cffi
    1.0a7
    % cffi::dyncall::Library create user32 user32.dll
    ::user32
    % user32 function
    wrong # args: should be "user32 function NAME RETURNTYPE PARAMDEFS"
    % user32 function GetKeyboardState int {state {uchar[256] out}}
    % GetKeyboardState
    Syntax: GetKeyboardState state
    % GetKeyboardState state
    1
    % set state
    0 0 0 0 0 0 0 0 0 0 0 0 0 129 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0
    

    Henceforth, I only plan on adding commands to twapi that cannot be done with the CFFI package which is a generic extension to call functions from DLLs. Any feedback appreciated (in the CFFI repository)

    /Ashok

     
  • Ashok P. Nadkarni

    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB