Buggy code:
inputs . wVk = ( ( short ) ( Display . untranslateKey ( event . keyCode ) ) ) ; if ( ( inputs . wVk ) == 0 ) { char key = event . character ; switch ( key ) { case SWT . BS : inputs . wVk = ( ( short ) ( OS . VK_BACK ) ) ; break ; case SWT . CR : inputs . wVk = ( ( short ) ( OS . VK_RETURN ) ) ; break ; case SWT . DEL : inputs . wVk = ( ( short ) ( OS . VK_DELETE ) ) ; break ; case SWT . ESC : inputs . wVk = ( ( short ) ( OS . VK_ESCAPE ) ) ; break ; case SWT . TAB : inputs . wVk = ( ( short ) ( OS . VK_TAB ) ) ; break ; case SWT . LF : return false ; default : { if ( OS . IsWinCE ) { inputs . wVk = OS . CharUpper ( ( ( short ) ( key ) ) ) ; } else { inputs . wVk = OS . VkKeyScan ( ( ( short ) ( Display . wcsToMbcs ( key , 0 ) ) ) ) ; if ( ( inputs . wVk ) == ( - 1 ) ) return false ; inputs . wVk &= 255 ; } } } } inputs . dwFlags = ( type == ( SWT . KeyUp ) ) ? OS . KEYEVENTF_KEYUP : 0 ; int hHeap = OS . GetProcessHeap ( ) ; int pInputs = OS . HeapAlloc ( hHeap , HEAP_ZERO_MEMORY , sizeof ) ; OS . MoveMemory ( pInputs , new int [ ] { OS . INPUT_KEYBOARD } , 4 ) ; OS . MoveMemory ( ( pInputs + 4 ) , inputs , KEYBDINPUT . sizeof ) ; boolean result = ( OS . SendInput ( 1 , pInputs , sizeof ) ) != 0 ; OS . HeapFree ( hHeap , 0 , pInputs ) ; return result ; } case SWT . MouseDown : case SWT . MouseMove : case SWT . MouseUp : case SWT . MouseWheel : { MOUSEINPUT inputs = new MOUSEINPUT ( ) ; if ( type == ( SWT . MouseMove ) ) { inputs . dwFlags = ( OS . MOUSEEVENTF_MOVE ) | ( OS . MOUSEEVENTF_ABSOLUTE ) ; int x = 0 ; int y = 0 ; int width = 0 ; int height = 0 ; if ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 5 , 0 ) ) ) { inputs . dwFlags |= OS . MOUSEEVENTF_VIRTUALDESK ; x = OS . GetSystemMetrics ( SM_XVIRTUALSCREEN ) ; y = OS . GetSystemMetrics ( SM_YVIRTUALSCREEN ) ; width = OS . GetSystemMetrics ( SM_CXVIRTUALSCREEN ) ; height = OS . GetSystemMetrics ( SM_CYVIRTUALSCREEN ) ; } else { width = OS . GetSystemMetrics ( SM_CXSCREEN ) ; height = OS . GetSystemMetrics ( SM_CYSCREEN ) ; } inputs . dx = ( ( ( ( ( event . x ) - x ) * 65535 ) + width ) - 2 ) // ( width - 1 ) ; inputs . dy = ( ( ( ( ( event . y ) - y ) * 65535 ) + height ) - 2 ) // ( height - 1 ) ; } else { if ( type == ( SWT . MouseWheel ) ) { if ( ( OS . WIN32_VERSION ) < ( OS . VERSION ( 5 , 0 ) ) ) return false ; inputs . dwFlags = OS . MOUSEEVENTF_WHEEL ; switch ( event . detail ) { case SWT . SCROLL_PAGE : inputs . mouseData = ( event . count ) * ( OS . WHEEL_DELTA ) ; break ; case SWT . SCROLL_LINE : int [ ] value = new int [ 1 ] ; OS . SystemParametersInfo ( SPI_GETWHEELSCROLLLINES , 0 , value , 0 ) ; <START_BUG> inputs . mouseData = ( ( event . detail ) * ( OS . WHEEL_DELTA ) ) // ( value [ 0 ] ) ; <END_BUG> break ; default : return false ; } } else { switch ( event . button ) { case 1 : inputs . dwFlags = ( type == ( SWT . MouseDown ) ) ? OS . MOUSEEVENTF_LEFTDOWN : OS . MOUSEEVENTF_LEFTUP ; break ; case 2 : inputs . dwFlags = ( type == ( SWT . MouseDown ) ) ? OS . MOUSEEVENTF_MIDDLEDOWN : OS . MOUSEEVENTF_MIDDLEUP ; break ; case 3 : inputs . dwFlags = ( type == ( SWT . MouseDown ) ) ? OS . MOUSEEVENTF_RIGHTDOWN : OS . MOUSEEVENTF_RIGHTUP ; break ; case 4 : { if ( ( OS . WIN32_VERSION ) < ( OS . VERSION ( 5 , 0 ) ) ) return false ; inputs . dwFlags = ( type == ( SWT . MouseDown ) ) ? OS . MOUSEEVENTF_XDOWN : OS . MOUSEEVENTF_XUP ; inputs . mouseData = OS . XBUTTON1 ; break ; } case 5 : { if ( ( OS . WIN32_VERSION ) < ( OS . VERSION ( 5 , 0 ) ) ) return false ; inputs . dwFlags = ( type == ( SWT . MouseDown ) ) ? OS . MOUSEEVENTF_XDOWN : OS . MOUSEEVENTF_XUP ; inputs . mouseData = OS . XBUTTON2 ; break ; } default : return false ; } } } int hHeap = OS . GetProcessHeap ( ) ; int pInputs = OS . HeapAlloc ( hHeap , HEAP_ZERO_MEMORY , sizeof ) ; OS . MoveMemory ( pInputs , new int [ ] { OS . INPUT_MOUSE } , 4 ) ;

Fix:
inputs . mouseData = ( ( event . count ) * ( OS . WHEEL_DELTA ) ) // ( value [ 0 ] ) ;