Browse Source

Updated docs + misc tweaks and fixes.

Mark Sibly 9 years ago
parent
commit
6af1a857c8

+ 2 - 2
modules/mojo/app/event.monkey2

@@ -45,7 +45,7 @@ Enum EventType
 	Eaten=$80000000
 End
 
-#rem monkeydoc Event class
+#rem monkeydoc The Event class.
 #end
 Class Event Abstract
 
@@ -92,7 +92,7 @@ Class Event Abstract
 	End
 End
 
-#rem monkeydoc The KeyEvent class
+#rem monkeydoc The KeyEvent class.
 #end
 Class KeyEvent Extends Event
 

+ 2 - 0
modules/mojo/app/skin.monkey2

@@ -1,6 +1,8 @@
 
 Namespace mojo.app
 
+#rem monkeydoc @hidden
+#end
 Class Skin
 
 	Property Image:Image()

+ 47 - 8
modules/mojo/app/style.monkey2

@@ -1,24 +1,32 @@
 
 Namespace mojo.app
 
+#rem monkeydoc The Style class.
+#end
 Class Style
 
 	Method New()
 		Init( "",Null,False )
 	End
 	
-	Method New( name:String )
-		Init( name,Null,False )
-	End
-	
 	Method New( style:Style )
 		Init( "",style,True )
 	End
 	
+	#rem monkeydoc @hidden
+	#end
+	Method New( name:String )
+		Init( name,Null,False )
+	End
+	
+	#rem monkeydoc @hidden
+	#end
 	Method New( name:String,style:Style )
 		Init( name,style,True )
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Method AddState:Style( state:String,srcState:String="" )
 	
 		Local style:=New Style
@@ -30,6 +38,8 @@ Class Style
 		Return style
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Method GetState:Style( state:String )
 	
 		Local style:=_states[state]
@@ -38,68 +48,92 @@ Class Style
 		Return Self
 	End
 
+	#rem monkeydoc Background color.
+	#end
 	Property BackgroundColor:Color()
 		Return _bgcolor
 	Setter( backgroundColor:Color )
 		_bgcolor=backgroundColor
 	End
 	
+	#rem monkeydoc Padding rect.
+	#end
 	Property Padding:Recti()
 		Return _padding
 	Setter( padding:Recti )
 		_padding=padding
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Property Skin:Skin()
 		Return _skin
 	Setter( skin:Skin )
 		_skin=skin
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Property SkinColor:Color()
 		Return _skcolor
 	Setter( skinColor:Color )
 		_skcolor=skinColor
 	End
 		
+	#rem monkeydoc Border rect.
+	#end
 	Property Border:Recti()
 		Return _border
 	Setter( border:Recti )
 		_border=border
 	End
 	
+	#rem monkeydoc Border color.
+	#End
 	Property BorderColor:Color()
 		Return _bdcolor
 	Setter( borderColor:Color )
 		_bdcolor=borderColor
 	End
-	
+
+	#rem monkeydoc Margin rect.
+	#end
 	Property Margin:Recti()
 		Return _margin
 	Setter( margin:Recti )
 		_margin=margin
 	End
 	
+	#rem monkeydoc Default canvas color.
+	#end
 	Property DefaultColor:Color()
 		Return _color
 	Setter( color:Color )
 		_color=color
 	End
-	
+
+	#rem monkeydoc Default canvas font.
+	#end	
 	Property DefaultFont:Font()
 		Return _font
 	Setter( font:Font )
 		_font=font
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Method SetImage( name:String,image:Image )
 		_images[name]=image
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Method GetImage:Image( name:String )
 		Return _images[name]
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Property Bounds:Recti()
 		Local bounds:=Padding
 		Local skin:=Skin
@@ -109,6 +143,8 @@ Class Style
 		Return bounds
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Method Render( canvas:Canvas,bounds:Recti )
 	
 		canvas.BlendMode=BlendMode.Alpha
@@ -158,6 +194,8 @@ Class Style
 		
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Function GetStyle:Style( name:String )
 	
 		Local style:=_styles[name]
@@ -166,12 +204,13 @@ Class Style
 		Local i:=name.Find( ":" )
 		If i<>-1 Return GetStyle( name.Slice( 0,i ) )
 		
+		If Not _defaultStyle _defaultStyle=New Style
 		Return _defaultStyle
 	End
 
 	Private
 	
-	Global _defaultStyle:=New Style
+	Global _defaultStyle:Style
 	Global _styles:=New StringMap<Style>
 	
 	Field _states:=New StringMap<Style>
@@ -181,7 +220,7 @@ Class Style
 	Field _skin:Skin
 	Field _skcolor:Color=Color.White
 	Field _border:Recti
-	Field _bdcolor:Color=Color.Black
+	Field _bdcolor:Color=Color.None
 	Field _margin:Recti
 	Field _color:Color
 	Field _font:Font

+ 6 - 4
modules/mojo/app/view.monkey2

@@ -1,6 +1,8 @@
 
 Namespace mojo.app
 
+#rem monkeydoc The View class.
+#end
 Class View
 
 	Method New()
@@ -8,7 +10,7 @@ Class View
 		_style=New Style
 	End
 
-	#rem monkeydoc View visible flag.
+	#rem monkeydoc @hidden View visible flag.
 	
 	Use [[ReallyVisible]] to test if the view is really visible.
 	
@@ -23,7 +25,7 @@ Class View
 		_visible=visible
 	End
 
-	#rem monkeydoc View visibility state.
+	#rem monkeydoc @hidden View visibility state.
 	
 	True if the view's visibility flag is set AND all its parent visibility flags up to the root window are also set.
 	
@@ -33,7 +35,7 @@ Class View
 		Return _visible And (Not _parent Or _parent.ReallyVisible)
 	End
 	
-	#rem monkeydoc View enabled flag.
+	#rem monkeydoc @hidden View enabled flag.
 	
 	Use [[ReallyEnabled]] to test if the view is really enabled.
 	
@@ -50,7 +52,7 @@ Class View
 		InvalidateStyle()
 	End
 
-	#rem monkeydoc View enabled state.
+	#rem monkeydoc @hidden View enabled state.
 	
 	True if the view's enabled flag is set AND all its parent enabled flags are set AND [[ReallyVisible]] is also true. 
 	

+ 33 - 2
modules/mojo/audio/audio.monkey2

@@ -7,8 +7,12 @@ Global _alloced:Int[]
 
 Public
 
-Global Audio:=New AudioDevice
+#rem monkeydoc Global instance of the AudioDevice class.
+#end
+Const Audio:=New AudioDevice
 
+#rem monkeydoc The AudioDevice class.
+#end
 Class AudioDevice
 
 	'***** Internal *****
@@ -31,8 +35,12 @@ Class AudioDevice
 	
 End
 
+#rem monkeydoc The Sound class.
+#end
 Class Sound
 
+	#rem monkeydoc Plays a sound.
+	#end
 	Method Play:Channel( loops:Int=0 )
 
 		Local channel:=New Channel
@@ -41,6 +49,8 @@ Class Sound
 		Return channel
 	End
 
+	#rem monkeydoc Loads a sound.
+	#end
 	Function Load:Sound( path:String )
 	
 		Local data:=DataBuffer.Load( path )
@@ -63,16 +73,27 @@ Class Sound
 	
 End
 
+#rem monkeydoc The Channel class.
+#end
 Class Channel
 
+	#rem monkeydoc Creates a new channel.
+	#end
 	Method New()
 	End
 
+	#rem monkeydoc True if this channel is playing audio.
+	
+	If the channel is playing audio but is in the paused state, this property will still return true.
+
+	#end
 	Property Playing:Bool()
 		If Invalid Return False
 		Return Mix_Playing( _id & 31 )
 	End
 	
+	#rem monkeydoc Channel volume in the range 0 to 1.
+	#end
 	Property Volume:Float()
 		If Invalid Return 0
 		Return _volume
@@ -81,17 +102,23 @@ Class Channel
 		_volume=Clamp( volume,0.0,1.0 )
 		Mix_Volume( _id & 31,_volume*128 )
 	End
-	
+
+	#rem monkeydoc Channel playback rate.
+	#end	
 	Property Rate:Float()
 		Return 1
 	Setter( rate:Float )
 	End
 	
+	#rem monkeydoc Channel pan in the range -1 to 1.
+	#end
 	Property Pan:Float()
 		Return 0
 	Setter( pan:Float )
 	End
 	
+	#rem monkeydoc Channel paused state.
+	#end
 	Property Paused:Bool()
 		If Invalid Return False
 		Return Mix_Paused( _id & 31 )
@@ -100,6 +127,8 @@ Class Channel
 		Mix_Pause( _id & 31 )
 	End
 	
+	#rem monkeydoc Plays a sound through the channel.
+	#end
 	Method Play:Bool( sound:Sound,loops:Int=0 )
 	
 		Local id:=_id & 31
@@ -116,6 +145,8 @@ Class Channel
 		Return True
 	End
 	
+	#rem monkeydoc Stops the channel.
+	#end
 	Method Stop()
 		If Invalid Return
 		Mix_HaltChannel( _id )

+ 38 - 2
modules/mojo/graphics/font.monkey2

@@ -2,13 +2,18 @@
 Namespace mojo.graphics
 
 #rem monkeydoc The Glyph struct.
+
+Glyph are used to store the individual character data for fonts.
+
 #end
 Struct Glyph
 
 	Field rect:Recti
 	Field offset:Vec2f
 	Field advance:Float
-	
+
+	#rem monkeydoc Creates a new glyph.
+	#end
 	Method New( rect:Recti,offset:Vec2f,advance:Float )
 		Self.rect=rect
 		Self.offset=offset
@@ -18,9 +23,26 @@ Struct Glyph
 End
 
 #rem monkeydoc The Font class.
+
+Mojo fonts use an image atlas system for storing font data.
+
+The glyph struct is used to store the location, size and advance for individual characters within a font.
+All character image data for a font must A font must occupy a single image, 
+
 #end
 Class Font
 
+	#rem monkeydoc Creates a new font.
+
+	@param image The image atlas.
+
+	@param height The height of the font in pixels.
+
+	@param firstChar The first character contained in the font.
+
+	@param glyphs An array of glyph structs describing the characters in the font.
+
+	#end
 	Method New( image:Image,height:Float,firstChar:Int,glyphs:Glyph[] )
 		_image=image
 		_height=height
@@ -28,21 +50,29 @@ Class Font
 		_glyphs=glyphs
 	End
 	
+	#rem monkeydoc The font image atlas.
+	#end
 	Property Image:Image()
 	
 		Return _image
 	End
 	
+	#rem monkeydoc The font height in pixels.
+	#end
 	Property Height:Float()
 	
 		Return _height
 	End
 	
+	#rem monkeydoc The first character contained in the font.
+	#end
 	Property FirstChar:Int()
 	
 		Return _firstChar
 	End
 	
+	#rem monkeydoc The number of characters in the font.
+	#end
 	Property NumChars:Int()
 	
 		Return _glyphs.Length
@@ -55,11 +85,15 @@ Class Font
 		Return _glyphs
 	End
 	
+	#rem monkeydoc Gets a glyph from the font.
+	#end
 	Method GetGlyph:Glyph( char:Int )
 		If char>=_firstChar And char<_firstChar+_glyphs.Length Return _glyphs[ char-_firstChar ]
 		Return _glyphs[0]
 	End
 	
+	#rem monkedoc Measures the width of some text when rendered by the font.
+	#end
 	Method TextWidth:Float( text:String )
 		Local w:=0.0
 		For Local char:=Eachin text
@@ -84,7 +118,9 @@ Class Font
 	End
 
 	'Make this ALWAYS work!	
-	Function Load:Font( path:String,height:Float,textureFlags:TextureFlags=TextureFlags.Filter|TextureFlags.Mipmap,shader:Shader=Null )
+	#rem monkeydoc Loads a font from a ttf file.
+	#end
+	Function Load:Font( path:String,height:Float,textureFlags:TextureFlags=Null,shader:Shader=Null )
 	
 		If Not shader shader=Shader.GetShader( "font" )
 		

+ 115 - 1
modules/mojo/graphics/image.monkey2

@@ -2,6 +2,11 @@
 Namespace mojo.graphics
 
 #rem monkeydoc The Image class.
+
+An image is a rectangular array of pixels that can be drawn using one of the [[Canvas.DrawImage]] methods.
+
+You can load an image from a file using the [[Load]].
+
 #end
 Class Image
 
@@ -9,6 +14,80 @@ Class Image
 	#end
 	Field OnDiscarded:Void()
 
+	#rem monkeydoc Creates a new image.
+	
+	New( pixmap,... ) allows you to create a new image from an existing pixmap.
+	
+	New( width,height,... ) allows you to create a new image that can be rendered to using a canvas. For images that will be frequently updated, use `TextureFlags.Filter|TextureFlags.Dynamic' for the best performance.
+	
+	New( image,rect,... ) allows you to create an image from within an 'atlas' image.
+	
+	@example
+	
+	Namespace myapp
+	
+	#Import "<std>"
+	#Import "<mojo>"
+	
+	Using std..
+	Using mojo..
+	
+	Class MyWindow Extends Window
+	
+		Field image1:Image
+		Field image2:Image
+		Field image3:Image
+			
+		Method New()
+	
+			'Create an image from a pixmap
+			Local pixmap:=New Pixmap( 16,16 )
+			pixmap.Clear( Color.Red )
+			image1=New Image( pixmap )
+			
+			'Create an image and render something to it
+			image2=New Image( 16,16 )
+			Local icanvas:=New Canvas( image2 )
+			icanvas.Color=Color.Yellow
+			icanvas.DrawRect( 0,0,8,8 )
+			icanvas.DrawRect( 8,8,8,8 )
+			icanvas.Color=Color.LightGrey
+			icanvas.DrawRect( 8,0,8,8 )
+			icanvas.DrawRect( 0,8,8,8 )
+			icanvas.Flush() 'Important!
+			
+			'Create a image from an atlas image
+			image3=New Image( image2,New Recti( 4,4,12,12 ) )
+			
+		End
+	
+		Method OnRender( canvas:Canvas ) Override
+		
+			canvas.DrawText( "Image1",0,0 )
+			canvas.DrawImage( image1,0,16 )
+			
+			canvas.DrawText( "Image2",0,40 )
+			canvas.DrawImage( image2,0,56 )
+	
+			canvas.DrawText( "Image3",0,80 )
+			canvas.DrawImage( image3,0,96 )
+			
+		End
+		
+	End
+	
+	Function Main()
+	
+		New AppInstance
+		
+		New MyWindow
+		
+		App.Run()
+	End
+	
+	@end
+	
+	#end
 	Method New( pixmap:Pixmap,textureFlags:TextureFlags=TextureFlags.Filter|TextureFlags.Mipmap,shader:Shader=Null )
 	
 		Local texture:=New Texture( pixmap,textureFlags )
@@ -31,6 +110,7 @@ Class Image
 		OnDiscarded+=Lambda()
 			texture.Discard()
 		End
+
 	End
 	
 	Method New( image:Image,rect:Recti )
@@ -66,21 +146,32 @@ Class Image
 		Return _texture
 	End
 	
+	#rem monkeydoc @hidden The image's rect within its texture.
+	#endif
 	Property Rect:Recti()
 	
 		Return _rect
 	End
 	
+	#rem monkeydoc The width of the image's rect within its texture.
+	#end
 	Property Width:Int()
 	
 		Return _rect.Width
 	End
 	
+	#rem monkeydoc The height of the image's rect within its texture.
+	#end
 	Property Height:Int()
 	
 		Return _rect.Height
 	End
 
+	#rem monkeydoc The image handle.
+	
+	Image handle values are fractional, where 0,0 is the top-left of the image and 1,1 is the bottom-right.
+
+	#end
 	Property Handle:Vec2f()
 	
 		Return _handle
@@ -91,7 +182,14 @@ Class Image
 		
 		UpdateVertices()
 	End
+
+	#rem monkeydoc The image scale.
+	
+	The scale property provides a simple way to 'pre-scale' an image.
 	
+	Scaling an image this way is faster than using one of the 'scale' parameters of [[Canvas.DrawImage]].
+	
+	#end
 	Property Scale:Vec2f()
 	
 		Return _scale
@@ -103,11 +201,25 @@ Class Image
 		UpdateVertices()
 	End
 	
+	#rem monkeydoc The image bounds.
+	
+	The bounds rect represents the actual image vertices used when the image is drawn.
+	
+	Image bounds are affected by [[Scale]] and [[Handle]], and can be used for simple collision detection.
+	
+	#end
 	Property Bounds:Rectf()
 	
 		Return _vertices
 	End
 
+	#rem monkeydoc Image radius.
+	
+	The radius property returns the radius of the [[Bounds]] rect.
+	
+	Image bounds are affected by [[Scale]] and [[Handle]], and can be used for simple collision detection.
+	
+	#end
 	Property Radius:Float()
 	
 		Return _radius
@@ -127,7 +239,7 @@ Class Image
 		Return _texCoords
 	End
 	
-	#rem monkeydoc Release the image and any resource it uses.
+	#rem monkeydoc Releases the image and any resource it uses.
 	#end
 	Method Discard()
 		If _discarded Return
@@ -135,6 +247,8 @@ Class Image
 		OnDiscarded()
 	End
 	
+	#rem monkeydoc Loads an image from a file.
+	#end
 	Function Load:Image( path:String,textureFlags:TextureFlags=TextureFlags.Filter|TextureFlags.Mipmap,shader:Shader=Null )
 	
 		Local diffuse:=mojo.graphics.Texture.Load( path,textureFlags )

+ 2 - 0
modules/mojo/graphics/material.monkey2

@@ -1,6 +1,8 @@
 
 Namespace mojo.graphics
 
+#rem monkeydoc @hidden
+#end
 Class Material
 
 	Method New( shader:Shader )

+ 2 - 0
modules/mojo/graphics/shader.monkey2

@@ -268,6 +268,8 @@ Class ParamBuffer
 	Field _params:=New ShaderParam[32]
 End
 
+#rem monkeydoc @hidden
+#end
 Class Shader
 
 	Method New( sourceCode:String )

+ 4 - 2
modules/mojo/graphics/texture.monkey2

@@ -6,8 +6,8 @@ Namespace mojo.graphics
 | TextureFlags	| Description
 |:--------------|:-----------
 | Filter		| Enable filtering. When the texture is magnified, texel colors are interpolated giving a smooth/blurred result.
-| Mipmap		| Enable mipmapping. When the texture is minified, automcatically generated 'mipmaps' are used.
-| Dynamic		| Texture is frequently updated.
+| Mipmap		| Enable mipmapping. When the texture is minified, automatically pre-generated 'mipmaps' are used to give a smoother result.
+| Dynamic		| Texture is frequently updated. This flag should be set if the texture contents are regularly updated and don't need to be preserved.
 
 #end
 Enum TextureFlags
@@ -20,6 +20,8 @@ Enum TextureFlags
 	Dynamic=		$1000
 End
 
+#rem monkeydoc @hidden
+#end
 Class Texture
 
 	#rem monkeydoc @hidden

+ 34 - 2
modules/mojo/input/joystick.monkey2

@@ -1,7 +1,7 @@
 
 Namespace mojo.input
 
-#rem monkeydoc
+#rem monkeydoc Joystick hat directions.
 
 | JoystickHat value	| 
 |:------------------|
@@ -28,51 +28,76 @@ Enum JoystickHat	'SDL values...
 	LeftDown=Left|Down
 End
 
+#rem monkeydoc The JoystickDevice class.
+#end
 Class JoystickDevice Extends InputDevice
 
+	#rem monkeydoc @hidden
+	#end	
 	Property Name:String()
 		Return _name
 	End
 	
+	#rem monkeydoc @hidden
+	#end	
 	Property GUID:String()
 		Return _guid
 	End
 
+	#rem monkeydoc The number of axes supported by the joystick.
+	#end	
 	Property NumAxes:Int()
 		Return _numAxes
 	End
+
 	
+	#rem monkeydoc The number of balls upported by the joystick.
+	#end	
 	Property NumBalls:Int()
 		Return _numBalls
 	End
 	
+	#rem monkeydoc The number of buttons supported by the joystick.
+	#end	
 	Property NumButtons:Int()
 		Return _numButtons
 	End
 	
+	#rem monkeydoc The number of hats supported by the joystick.
+	#end	
 	Property NumHats:Int()
 		Return _numHats
 	End
 	
+	#rem monkeydoc Gets joystick axis value in the range -1 to 1.
+	#end	
 	Method GetAxis:Float( axis:Int )
 		Return (Float(SDL_JoystickGetAxis( _joystick,axis ))+32768)/32767.5-1
 	End
 	
+	#rem monkeydoc Gets joystick ball value.
+	#end	
 	Method GetBall:Vec2i( ball:Int )
 		Local x:Int,y:Int
 		SDL_JoystickGetBall( _joystick,ball,Varptr x,Varptr y )
 		Return New Vec2i( x,y )
 	End
 
+	#rem monkeydoc Gets joystick hat value.
+	#end	
 	Method GetHat:JoystickHat( hat:Int )
 		Return Cast<JoystickHat>( SDL_JoystickGetHat( _joystick,hat ) )
 	End
 
+	#rem monkeydoc Check up/down state of a button.
+	#end
 	Method ButtonDown:Bool( button:Int )
 		Return SDL_JoystickGetButton( _joystick,button )
 	End
 	
-	Method ButtonHit:Bool( button:Int )
+	#rem monkeydoc Checks is a button has been pressed.
+	#end
+	Method ButtonPressed:Bool( button:Int )
 		If ButtonDown( button )
 			If _hits[button] Return False
 			_hits[button]=True
@@ -82,6 +107,8 @@ Class JoystickDevice Extends InputDevice
 		Return False
 	End
 	
+	#rem monkeydoc Gets the number of joysticks attached.
+	#end
 	Function NumJoysticks:Int()
 		Return Min( SDL_NumJoysticks(),8 )
 	End
@@ -92,6 +119,11 @@ Class JoystickDevice Extends InputDevice
 		SDL_JoystickUpdate()
 	End
 	
+	#rem monkeydoc Opens a joystick device.
+	
+	@param index Joystick index.
+
+	#end
 	Function Open:JoystickDevice( index:Int )
 		Assert( index>=0 And index<8 )
 		Local joystick:=_joysticks[index]

+ 4 - 5
modules/mojo/input/keyboard.monkey2

@@ -16,12 +16,12 @@ Global bbKeyInfos:bbKeyInfo Ptr
 
 Public
 
-#rem monkeydoc Application keyboard device instance.
+#rem monkeydoc Global instance of the KeyboardDevice class.
 
 #end
 Const Keyboard:=New KeyboardDevice
 
-#rem monkeydoc The KeyboardDevice singleton class.
+#rem monkeydoc The KeyboardDevice class.
 
 All method that take a `key` parameter can also be used with 'raw' keys.
 
@@ -169,7 +169,7 @@ Class KeyboardDevice Extends InputDevice
 	#rem monkeydoc @hidden
 	#end
 	Method KeyCodeToKey:Key( keyCode:Int )
-		If (keyCode & $40000000) keyCode=(keyCode & ~$40000000)-$39+$80
+		If (keyCode & $40000000) keyCode=(keyCode & ~$40000000)+$80
 		Return Cast<Key>( keyCode )
 	End
 	
@@ -205,7 +205,6 @@ Class KeyboardDevice Extends InputDevice
 #Endif
 			_scan2key[_key2scan[key]]=scanCode
 			
-			
 			p=p+1
 		Wend
 		
@@ -242,7 +241,7 @@ Class KeyboardDevice Extends InputDevice
 		Case SDL_KEYDOWN
 		
 			Local kevent:=Cast<SDL_KeyboardEvent Ptr>( event )
-		
+			
 			_matrix[kevent->keysym.scancode]=True
 			
 			Select kevent->keysym.sym

+ 2 - 2
modules/mojo/input/keycodes.monkey2

@@ -119,14 +119,14 @@ Enum Key
 	A=97,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
 	KeyDelete=127
 	
-	CapsLock=128,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12
+	CapsLock=185,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12
 	PrintScreen,ScrollLock,Pause,Insert,Home,PageUp,nop,KeyEnd,PageDown
 	Right,Left,Down,Up
 	KeypadNumLock,KeypadDivide,KeypadMultiply,KeypadMinus,KeypadPlus,KeypadEnter
 	Keypad1,Keypad2,Keypad3,Keypad4,Keypad5,Keypad6,Keypad7,Keypad8,Keypad9,Keypad0
 	KeypadPeriod
 	
-	LeftControl=295,LeftShift,LeftAlt,LeftGui,RightControl,RightShift,RightAlt,RightGui
+	LeftControl=185+167,LeftShift,LeftAlt,LeftGui,RightControl,RightShift,RightAlt,RightGui
 	
 	Raw=$10000
 	

+ 36 - 16
modules/mojo/input/mouse.monkey2

@@ -1,7 +1,7 @@
 
 Namespace mojo.input
 
-#rem monkeydoc Application mouse device instance.
+#rem monkeydoc Global instance of the MouseDevice class.
 #end
 Const Mouse:=New MouseDevice
 
@@ -21,9 +21,9 @@ Enum MouseButton
 	Right=3
 End
 
-#rem monkeydoc The MouseDevice singleton class.
+#rem monkeydoc The MouseDevice class.
 
-To access the mouse device, use the [[Mouse]] constant.
+To access the mouse device, use the global [[Mouse]] constant.
 
 The mouse device should only used after a new [[app.AppInstance]] is created.
 
@@ -39,6 +39,8 @@ Class MouseDevice Extends InputDevice
 		Next
 	End
 	
+	#rem monkeydoc Pointer visiblity state.
+	#end
 	Property PointerVisible:Bool()
 	
 		Return SDL_ShowCursor( -1 )=SDL_ENABLE
@@ -49,23 +51,42 @@ Class MouseDevice Extends InputDevice
 	
 	End
 	
+	#rem monkeydoc X coordinate of the mouse location.
+	#end
 	Property X:Int()
 		Return Location.x
 	End
 	
+	#rem monkeydoc Y coordinate of the mouse location.
+	#end
 	Property Y:Int()
 		Return Location.y
 	End
 
+	#rem monkeydoc The mouse location.
+	#end
 	Property Location:Vec2i()
 		Return _location
 	End
 	
+	#rem monkeydoc Checks the current up/down state of a mouse button.
+	
+	Returns true if `button` is currently held down.
+	
+	@param button Button to checl.
+	#end
 	Method ButtonDown:Bool( button:MouseButton )
 		DebugAssert( button>=0 And button<4,"Mouse buttton out of range" )
 		Return _buttons[button]
 	End
 
+	#rem monkeydoc Checks if a mouse button was pressed.
+	
+	Returns true if `button` was pressed since the last call to ButtonPressed with the same button.
+
+	@param button Button to check.
+	
+	#end
 	Method ButtonPressed:Bool( button:MouseButton )
 		DebugAssert( button>=0 And button<4,"Mouse buttton out of range" )
 		If _buttons[button]
@@ -77,6 +98,13 @@ Class MouseDevice Extends InputDevice
 		Return False
 	End
 	
+	#rem monkeydoc Checks if a mouse button was released.
+	
+	Returns true if `button` was released since the last call to ButtonReleased with the same button.
+	
+	@param button Button to check.
+	
+	#end
 	Method ButtonReleased:Bool( button:MouseButton )
 		DebugAssert( button>=0 And button<4,"Mouse buttton out of range" )
 		If Not _buttons[button]
@@ -88,24 +116,16 @@ Class MouseDevice Extends InputDevice
 		Return False
 	End
 	
+	#rem monkeydoc @hidden
+	#end
 	Method ButtonHit:Bool( button:MouseButton )
 		Return ButtonPressed( button )
 	End
-	
-	#rem monkeydoc @hidden
-	#end	
-	'Method GetButton:Bool( index:Int ) Override
-	'	Return ButtonDown( Cast<MouseButton>( index ) )
-	'End
-	
-	#rem monkeydoc @hidden
-	#end	
-	'Method GetPointer:Vec2i( index:Int ) Override
-	'	Return Location
-	'End
-	
+
 	'***** Internal *****
 
+	#rem monkeydoc @hidden
+	#end
 	Method Init()
 		If _init Return
 		App.Idle+=Poll

+ 1 - 3
modules/std/graphics/pixmaploader.monkey2

@@ -1,13 +1,11 @@
 
 Namespace std.graphics
 
-#Import "<stb-image>"
+Private
 
 Using stb.image
 Using std.stream
 
-Private
-
 Struct stbi_user
 	Field stream:Stream
 End