woshichuanqilz
V2EX  ›  硬件

程序有没有办法区分不同的鼠标?

  •  
  •   woshichuanqilz · May 20, 2018 · 3021 views
    This topic created in 2920 days ago, the information mentioned may be changed or developed.

    比如举个例子, 我想让一个程序在一个特定的鼠标插上之后才能运行, 这个可不可以实现。

    我 google 了一下发现鼠标是没有一个 unique id 的, stackoverflow

    HidD_GetSerialNumberString

    https://www.cnblogs.com/hdsong/p/7792694.html

    然后我看了一下: 这个里面的信息 这两个也不行 20180520214941

    这个 HID 似乎不是唯一的: 20180520215136

    是不是没有一个 unique id 可以识别一个鼠标, 有没有其他的方法指点一下。

    或者能不能在一个鼠标上加上自己的一些芯片什么类似的东西。。。这个芯片携带唯一的识别码。

    6 replies    2018-05-27 23:52:21 +08:00
    iwtbauh
        1
    iwtbauh  
       May 20, 2018 via Android
    USB 鼠标可以看厂商 ID 和设备 ID
    woshichuanqilz
        2
    woshichuanqilz  
    OP
       May 20, 2018
    @iwtbauh 设备 id 怎么看?
    geelaw
        3
    geelaw  
       May 20, 2018
    提示:Windows MultiPoint Mouse SDK
    iwtbauh
        4
    iwtbauh  
       May 21, 2018 via Android
    @woshichuanqilz 和其他 USB 设备一样看。Windows 我不知道,Linux 可以用 sysfs
    qwertyegg
        5
    qwertyegg  
       May 22, 2018
    当然可以,不然 logitech gaming software 怎么工作
    johnnie502
        6
    johnnie502  
       May 27, 2018
    设备 ID 和厂商 ID 都不是唯一到某个设备的,只是唯一到某个型号,估计是想拿来加密用吧,鼠标这条路应该不行。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2856 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 124ms · UTC 00:30 · PVG 08:30 · LAX 17:30 · JFK 20:30
    ♥ Do have faith in what you're doing.