MACXTMouse = {}
REGISTRY:Read("MACXT","Vitesse_Souris")
function MACXTMouse:Mouse()
   MACXTKeyPad = Controls.read()
   if MACXTMouseActive == 1 then
      if math.abs(MACXTKeyPad:analogX()) > 32 then
         x = x + MACXTKeyPad:analogX() / Vitesse_Souris
      end
      if math.abs(MACXTKeyPad:analogY()) > 32 then
         y = y + MACXTKeyPad:analogY() / Vitesse_Souris
      end
   end
   if MACXTMousePad == 1 then
      if MACXTKeyPad:up() then
         y = y - 6
      end
      if MACXTKeyPad:down() then
         y = y + 6
      end
      if MACXTKeyPad:left() then
         x = x - 6
      end
      if MACXTKeyPad:right() then
         x = x + 6
      end
   end
   if x < 0 then
	   x = 0
   end
   if y < 0 then
	   y = 0
   end
   if x > 510-MACXT_Mouse:width() then
	   x = 510-MACXT_Mouse:width()
   end
   if y > 300-MACXT_Mouse:height() then
	   y = 300-MACXT_Mouse:height()
   end
end
function MACXTMouse:Change_Mouse_Image(Image_Mouse)
   if Image_Mouse ~= nil then
      MACXT_Mouse = Image_Mouse
   end
end
function MACXTMouse:DesactivePadAnalog()
   MACXTMouseActive = 0
end
function MACXTMouse:ActivePadAnalog()
   MACXTMouseActive = 1
end
function MACXTMouse:DesactivePad()
   MACXTMousePad = 0
end
function MACXTMouse:ActivePad()
   MACXTMousePad = 1
end
MACXTMouse:ActivePadAnalog()
MACXTMouse:ActivePad()