uinput.h wrapper lazarus / 21-General ---------------------------------------------------------------------- freemind001 · 2023-04-17 18:29 is it possible to "translate" UI_SET_EVBIT definition to pascal? Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #define UINPUT_IOCTL_BASE       'U'#define UI_SET_EVBIT            _IOW(UINPUT_IOCTL_BASE, 100, int)this constant is defined in uinput.h and is equal to 1074025828 at runtime Is it correct just to declare it as Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   const     UI_SET_EVBIT = 1074025828;  //magic number ---------------------------------------------------------------------- marcov · 2023-04-17 18:38 Since they are mostly and and ors, it is customary to notate them ias a hexadecimal constant. But yes, that is how it is usually done. ---------------------------------------------------------------------- MarkMLl · 2023-04-17 18:40 I think you also need to consider the definition of the _IOW macro. My recollection is that it's frequently used in the definition of e.g. ioctl() operations specific to various low-level hardware, and as such you need to be aware of the potential for mayhem caused by different word sizes, for carnage caused by incorrect endianness, and for havoc caused by subtle variations in packing behaviour. MarkMLl ---------------------------------------------------------------------- freemind001 · 2023-04-17 19:53 Quote from: marcov on April 17, 2023, 08:38:58 pmhexadecimal doesn't work Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   UI_SET_EVBIT  = $40045564;  //1074025828;  //magic numbers  UI_DEV_SETUP  = $405C5503;  //1079792899;  UI_SET_KEYBIT = $40045565;  //1074025829;  UI_DEV_CREATE = $5501;      //21761;   decimal were ok why? ---------------------------------------------------------------------- howardpc · 2023-04-17 20:40 Maybe you need to cast them as signed integers? ---------------------------------------------------------------------- MarkMLl · 2023-04-18 06:51 Quote from: howardpc on April 17, 2023, 10:40:08 pmMaybe you need to cast them as signed integers? If OP's doing what I think he's doing then it should be of type TIOCtlRequest which the RTL defines as a culong. MarkMLl