Coder Social home page Coder Social logo

Comments (4)

MasterGroosha avatar MasterGroosha commented on August 18, 2024

So, I'm using your example №2 to get info for "Left Windows" button.
Rows 1 & 2 are from keyboard while rows 3 & 4 are from touchpad. You see, there is no difference, and I cannot get any specific info about devices. What modifications to example №2 should I make to get at least DeviceIDs? And how to filter them later using AHKHID?
image

from ahkhid.

MasterGroosha avatar MasterGroosha commented on August 18, 2024

So somehow I managed to get handle (?) of device. However I don't know how to filter input based on that handle (?) and how to make it permanent. I guess the numbers will change after reboot.

#NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
#Include AHKHID.ahk

AHKHID_UseConstants()

;Intercept WM_INPUT
OnMessage(0x00FF, "InputMsg")
AHKHID_AddRegister(1)
AHKHID_AddRegister(1, 6, 0)
AHKHID_Register()

iCount := AHKHID_GetRegisteredDevs(uDev)
msgbox, %iCount%

OnMessage(0x00FF, "InputMsg")

InputMsg(wParam, lParam) {
    Local r, h
    Critical    ;Or otherwise you could get ERROR_INVALID_HANDLE
    
    ;Get device type
    d_handle := AHKHID_GetInputInfo(lParam, II_DEVHANDLE)
    btn_id := AHKHID_GetInputInfo(lParam, II_KBD_VKEY) 
}

from ahkhid.

MasterGroosha avatar MasterGroosha commented on August 18, 2024

And the core problem is that setting AHKHID_AddRegister(1, 6, 0, RIDEV_INPUTSINK) doesn't allow to grab input from any window, only when script is in foreground (despine RIDEV_INPUTSINK being set)

from ahkhid.

 avatar commented on August 18, 2024

I have the same problem. I can't obtain which keyboard has send the key.

from ahkhid.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.