inputanalog_query(3)

๐Ÿ“ฆ
version 0.7.1 ยท 2 versions
, in nixos 26.05

๐ŸŽ€ inputanalog_query(3) โ€” the Arcan Lua API page, bestie edition ๐ŸŽ€

okay so real talk, this is a page from the Arcan Lua API and it's about inputanalog_query โ€” asking your analog devices what their filtering situation looks like ๐Ÿ’…


โœจ NAME โœจ

inputanalog_query โ€” Query analog devices for filtering details ๐Ÿ”๐ŸŽฎ


๐Ÿซถ SYNOPSIS ๐Ÿซถ

analogtbl_tbl or analogtbl
inputanalog_query( devnum, axnum, rescan )

๐ŸŒธ DESCRIPTION ๐ŸŒธ

So this function lets you query a device for analog device options and current values ๐Ÿ’– โ€” and you've got two whole modes, icons only:

  • globally โ€” call it with no arguments and you get a table of analogtbl back ๐ŸŽ€
  • from a specific device โ€” pass devnum, and optionally an axis too

and here's the little extra: if rescan is set to != 0, the input subsystem will first scan for new devices โœจ lowkey a whole refresh moment.


๐Ÿ’… NOTES ๐Ÿ’…

  1. rescan is a rather costly operation and may possibly lose data for devices that doesn't identify properly ๐Ÿ˜ญ so likeโ€ฆ be careful, no cap.
  2. analogtbl members, and yes we're going through every single one because they all matter ๐Ÿซถ:
    • devid, subid โ€” device and axis indices
    • upper_bound, lower_bound โ€” a value > upper and < lower will be discarded
    • deadzone โ€” abs(value) within deadzone will be discarded
    • kernel_size โ€” number of samples in for every sample out
    • mode(drop) โ€” analog processing disabled
    • mode(pass) โ€” emit every sample
    • mode(avg) โ€” average the kernel_size buffer
    • mode(latest) โ€” only emit when buffer full, and keep only most recent value

๐ŸŒˆ EXAMPLE ๐ŸŒˆ

function inputanalog_query0()
      local antbl = inputanalog_query();
      print(#antbl, "devices found.");
      for i = 1, #antbl do
            print("-----0);
            print(string.format("%d:%d, upper:%d, lower: %d, deadzone: %d, " ..
                  "kernel_size: %d, filter_mode: %s0, antbl[i].devid, antbl[i].subid,
                  antbl[i].upper_bound, antbl[i].lower_bound, antbl[i].deadzone,
                  antbl[i].kernel_size, antbl[i].mode));
            print("-----0);
      end
end

look at her go, looping through every device and printing the whole filter resume ๐Ÿ’€โœจ iconic.


๐Ÿ’€ MISUSE ๐Ÿ’€

function inputanalog_query0()
      inputanalog_query("ind");
end

yeahโ€ฆ that's the "don't do this" exhibit, bestie ๐Ÿ™ˆ noted and filed under not it.


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

  • iodev

and that's the whole page, fr fr ๐Ÿ’œ this one was written down in October 2026, living in inputanalog_query(3) โ€” go forth and query those analog devices, you've got this ๐Ÿ‘‘๐ŸŒธ

๐Ÿ“ฆ where this page comes from