How to detect mouse scroll events with the emulated mouse (connecting to a pc by VNC)?

Does anyone have any idea why the scroll is not tracked when I remotely connect to the computer via VNC? The scroll action itself is tracked, but the delta is always 0 (event->delta_y). I want to be able to detect in which direction I scroll (Up or Down) while working with my application remotely - using VNC. I was trying to go around this problem by using x11. This system tracks mouse scroll events correctly, but I must create a loop to track the event, not what I want. Also I was trying to get ( event->direction ), but it always returns SMOOTH_SCROLL, but should return the particular direction.