예제 #1
0
 public string ToJSON()
 {
     return(string.Format(FormatJSONEvent,
                          X.ToString(),
                          Y.ToString(),
                          Z.ToString(),
                          MouseButtons.ToString(),
                          ScrollDelta.ToString(),
                          BackgroundImage, BackgroundColor, BackgroundRepeat, BackgroundPosition, BackgroundAttachment,
                          Opacity.ToString(),
                          BorderCssString,
                          PulseMS));
 }
예제 #2
0
        static internal ScrollDelta GetEventWheelScroll(IntPtr inEvent)
        {
            ScrollDelta scrolldelta = new ScrollDelta();
            Int32       delta;

            unsafe
            {
                Int32 *  d = δ
                OSStatus result;

                // vertical scroll Delta in pixels
                result = API.GetEventParameter(inEvent,
                                               EventParamName.MouseWheelSmoothVerticalDelta, EventParamType.typeSInt32,
                                               IntPtr.Zero, (uint)sizeof(int), IntPtr.Zero, (IntPtr)d);

                if (result == OSStatus.EventParameterNotFound)
                {
                    // it's okay for it to be simply missing...
                }
                else if (result != OSStatus.NoError)
                {
                    throw new MacOSException(result);
                }
                else
                {
                    scrolldelta.deltaY = delta / 20.0f;
                }

                // horizontal scroll Delta in pixels
                result = API.GetEventParameter(inEvent,
                                               EventParamName.MouseWheelSmoothHorizontalDelta, EventParamType.typeSInt32,
                                               IntPtr.Zero, (uint)sizeof(int), IntPtr.Zero, (IntPtr)d);

                if (result == OSStatus.EventParameterNotFound)
                {
                    // it's okay for it to be simply missing...
                }
                else if (result != OSStatus.NoError)
                {
                    throw new MacOSException(result);
                }
                else
                {
                    scrolldelta.deltaY = delta / 20.0f;
                }
            }

            return(scrolldelta);
        }
예제 #3
0
        static internal ScrollDelta GetEventWheelScroll(IntPtr inEvent) 
        {
        	ScrollDelta scrolldelta = new ScrollDelta();
        	Int32 delta;
        	
        	unsafe 
        	{
        		Int32* d = δ
				OSStatus result;
				
				// vertical scroll Delta in pixels
				result = API.GetEventParameter(inEvent,
					 EventParamName.MouseWheelSmoothVerticalDelta, EventParamType.typeSInt32,
					 IntPtr.Zero, (uint)sizeof(int), IntPtr.Zero, (IntPtr)d);

				if (result == OSStatus.EventParameterNotFound) {
					// it's okay for it to be simply missing...
				} else if (result != OSStatus.NoError) {
					throw new MacOSException(result);
				} else {
					scrolldelta.deltaY = delta / 20.0f;
				}
				
				// horizontal scroll Delta in pixels
				result = API.GetEventParameter(inEvent,
					 EventParamName.MouseWheelSmoothHorizontalDelta, EventParamType.typeSInt32,
					 IntPtr.Zero, (uint)sizeof(int), IntPtr.Zero, (IntPtr)d);

				if (result == OSStatus.EventParameterNotFound) {
					// it's okay for it to be simply missing...
				} else if (result != OSStatus.NoError) {
					throw new MacOSException(result);
				} else {
					scrolldelta.deltaY = delta / 20.0f;
				}
			}

			return scrolldelta;
        }