MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / inputdevice_tablet

Function inputdevice_tablet

src/inputdevice.cpp:2882–2986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2880}
2881
2882void inputdevice_tablet (int x, int y, int z, int pressure, uae_u32 buttonbits, int inproximity, int ax, int ay, int az, int devid)
2883{
2884 if (is_touch_lightpen()) {
2885
2886 tablet_lightpen(x, y, tablet_maxx, tablet_maxy, inproximity ? 1 : -1, buttonbits, false, devid, -1);
2887
2888 } else {
2889 uae_u8 *p;
2890 uae_u8 tmp[MH_END];
2891
2892 mousehack_enable ();
2893 if (inputdevice_is_tablet () <= 0 || !mousehack_address)
2894 return;
2895 //write_log (_T("%d %d %d %d %08X %d %d %d %d\n"), x, y, z, pressure, buttonbits, inproximity, ax, ay, az);
2896 p = mousehack_address;
2897
2898 memcpy (tmp, p + MH_START, MH_END - MH_START);
2899#if 0
2900 if (currprefs.input_magic_mouse) {
2901 int maxx, maxy, diffx, diffy;
2902 int dw, dh, ax, ay, aw, ah;
2903 float xmult, ymult;
2904 float fx, fy;
2905
2906 fx = (float)x;
2907 fy = (float)y;
2908 desktop_coords (&dw, &dh, &ax, &ay, &aw, &ah);
2909 xmult = (float)tablet_maxx / dw;
2910 ymult = (float)tablet_maxy / dh;
2911
2912 diffx = 0;
2913 diffy = 0;
2914 if (picasso_on) {
2915 maxx = gfxvidinfo.width;
2916 maxy = gfxvidinfo.height;
2917 } else {
2918 get_custom_mouse_limits (&maxx, &maxy, &diffx, &diffy);
2919 }
2920 diffx += ax;
2921 diffy += ah;
2922
2923 fx -= diffx * xmult;
2924 if (fx < 0)
2925 fx = 0;
2926 if (fx >= aw * xmult)
2927 fx = aw * xmult - 1;
2928 fy -= diffy * ymult;
2929 if (fy < 0)
2930 fy = 0;
2931 if (fy >= ah * ymult)
2932 fy = ah * ymult - 1;
2933
2934 x = (int)(fx * (aw * xmult) / tablet_maxx + 0.5);
2935 y = (int)(fy * (ah * ymult) / tablet_maxy + 0.5);
2936
2937 }
2938#endif
2939 p[MH_X] = x >> 8;

Callers 1

tablet_sendFunction · 0.85

Calls 6

is_touch_lightpenFunction · 0.85
tablet_lightpenFunction · 0.85
mousehack_enableFunction · 0.85
inputdevice_is_tabletFunction · 0.85
desktop_coordsFunction · 0.85
get_custom_mouse_limitsFunction · 0.85

Tested by

no test coverage detected