Нашел такое, пробуй.
Спойлер Main Script:
Код:
#Basic Mouse System
#----------#
#Features: Provides a series of functions to find the current x, y position of
#                  the mouse and whether it is being clicked or not (left or right click)
#
#Usage:   Script calls:
#                  Mouse.pos?   - returns the x, y position as an array
#                  Mouse.lclick?(repeat) - returns if left click is achieved
#                                                                  repeat = true for repeated checks
#                  Mouse.rclick?(repeat) - same as above for right click
#                  Mouse.within?(rect) - passes a Rect through to check if cursor
#                                                                is within it, returns true if so
#
#No Customization
#
#----------#
#-- Script by: V.M of D.T
#--- Free to use in any non-commercial project with credit given

CPOS = Win32API.new 'user32', 'GetCursorPos', ['p'], 'v'
WINX = Win32API.new 'user32', 'FindWindowEx', ['l','l','p','p'], 'i'
ASKS = Win32API.new 'user32', 'GetAsyncKeyState', ['p'], 'i'
SMET = Win32API.new 'user32', 'GetSystemMetrics', ['i'], 'i'
WREC = Win32API.new 'user32', 'GetWindowRect', ['l','p'], 'v'

module Mouse
  def self.setup
        @delay = 0
        bwap = true if SMET.call(23) != 0
        bwap ? @lmb = 0x02 : @lmb = 0x01
        bwap ? @rmb = 0x01 : @rmb = 0x02
  end
  def self.update
        self.setup if @lmb.nil?
        @delay -= 1
        @window_loc = WINX.call(0,0,"RGSS PLAYER",0)
        if ASKS.call(@lmb) == 0 then @l_clicked = false end
        if ASKS.call(@rmb) == 0 then @r_clicked = false end
        rect = '0000000000000000'
        cursor_pos = '00000000'
        WREC.call(@window_loc, rect)
        side, top = rect.unpack("ll")
        CPOS.call(cursor_pos)
        @m_x, @m_y = cursor_pos.unpack("ll")
        w_x = side + SMET.call(5) + SMET.call(45)
        w_y = top + SMET.call(6) + SMET.call(46) + SMET.call(4)
        @m_x -= w_x; @m_y -= w_y
  end
  def self.pos?
        self.update
        return [@m_x, @m_y]
  end
  def self.lclick?(repeat = false)
        self.update
        return false if @l_clicked
        if ASKS.call(@lmb) != 0 then
          @l_clicked = true if !repeat
          return true end
  end
  def self.rclick?(repeat = false)
        self.update
        return false if @r_clicked
        if ASKS.call(@rmb) != 0 then
          @r_clicked = true if !repeat
          return true end
  end
  def self.slowpeat
        self.update
        return false if @delay > 0
        @delay = 120
        return true
  end
  def self.within?(rect)
        self.update
        return false if @m_x < rect.x or @m_y < rect.y
        bound_x = rect.x + rect.width; bound_y = rect.y + rect.height
        return true if @m_x < bound_x and @m_y < bound_y
        return false
  end
end


Спойлер Mouse Movement:
Код:
#Mouse Movement - Basic Mouse System Addon
#----------#
#Features: Moves the hero in a 4dir pattern based on where the mouse is currently
#                  while it's clicked. No pathfinding, just movement.
#
#Usage:   Plug and Play
#
#
#No Customization
#
#----------#
#-- Script by: V.M of D.T
#--- Same Terms as Basic Mouse System

class Game_Player < Game_Character
  alias mouse_move_update update
  def update
        mouse_move_update
        mouse_input
  end
  def mouse_input
        return if !movable? || $game_map.interpreter.running?
        if !Mouse.lclick?(true) then return end
        if moving? then return end
        pos = Mouse.pos?
        xx = $game_player.screen_x
        yy = $game_player.screen_y
        cen_pos = [xx,yy]
        x_diff = cen_pos[0] - pos[0]
        y_diff = cen_pos[1] - pos[1]
        if Mouse.within?(Rect.new(xx - 16,yy - 32,32,32)) then return end
        if x_diff > 0 and y_diff > 0
          x_diff >= y_diff ? move_straight(4) : move_straight(8)
          return
        end
        if x_diff < 0 and y_diff > 0
          x_diff *= -1
          x_diff >= y_diff ? move_straight(6) : move_straight(8)
          return
        end
        if x_diff > 0 and y_diff < 0
          y_diff *= -1
          x_diff >= y_diff ? move_straight(4) : move_straight(2)
          return
        end
        if x_diff < 0 and y_diff < 0
          x_diff *= -1
          y_diff *= -1
          x_diff >= y_diff ? move_straight(6) : move_straight(2)
          return
        end
  end
end


Спойлер Mouse Battle:
Код:
#Mouse Battle - Basic Mouse System Addon
#----------#
#Features: Adds basic mouse functionality to the default battle system!
#                  Left click pretty much acts as the accept button
#                  Right click pretty much acts as the cancel button
#
#Usage:   Plug and Play
#
#No Customization
#
#----------#
#-- Script by: V.M of D.T
#--- Same Terms as Basic Mouse System

class Scene_Battle
  WLH = 24
  OFS = 12
  alias mouse_update_basic update_basic
  def update_basic
        mouse_update_basic
        mouse_update
  end
  def mouse_update
        #ACTOR_WINDOW
        if @actor_window.active
          xx = Graphics.width - @enemy_window.width
          yy = Graphics.height - @enemy_window.height
          width = @actor_window.contents.width
          rectcm1 = Rect.new(xx + OFS, yy + OFS, width, WLH)
          rectcm2 = Rect.new(rectcm1.x, rectcm1.y + 24, width, WLH)
          rectcm3 = Rect.new(rectcm1.x, rectcm2.y + 24, width, WLH)
          rectcm4 = Rect.new(rectcm1.x, rectcm3.y + 24, width, WLH)
          rectttl = Rect.new(rectcm1.x, rectcm1.y, width * 2, WLH * 4)
          @actor_window.index = 0 if Mouse.within?(rectcm1)
          @actor_window.index = 1 if Mouse.within?(rectcm2)
          @actor_window.index = 2 if Mouse.within?(rectcm3)
          @actor_window.index = 3 if Mouse.within?(rectcm4)
          @actor_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
          @actor_window.process_cancel if Mouse.rclick? and Mouse.within?(rectttl)
        end
        #ITEM_WINDOW
        if @item_window.active
          xx = 0
          yy = @help_window.height
          width = @item_window.contents.width / 2
          hold_rect = []; temp = 2
          smax = [@item_window.item_max, ((@item_window.height - 24) / WLH) * 2].min
          rectttl = Rect.new(xx, yy, @item_window.contents.width, @item_window.contents.height)
          rectcmA = Rect.new(Graphics.width / 2 - 50, @help_window.height - 12, 100, 24)
          rectcmB = Rect.new(Graphics.width / 2 - 50, Graphics.height - @actor_command_window.height - 12, 100, 24)
          for i in Range.new(0,smax - 1)
                tempx = xx + OFS + width * (temp % 2)
                tempy = yy + OFS + 24 * ((temp / 2) - 1)
                hold_rect.push(Rect.new(tempx, tempy, width, WLH))
                temp += 1
          end
          @scroll = @item_window.top_row + (@item_window.top_row * 2 / 2)
          for i in Range.new(0,@item_window.item_max - 1)
                next if hold_rect[i].nil?
                @item_window.index = (i + @scroll) if Mouse.within?(hold_rect[i])
          end
          @item_window.cursor_down if Mouse.within?(rectcmB) and Mouse.slowpeat
          @item_window.cursor_up if Mouse.within?(rectcmA) and Mouse.slowpeat
          @item_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
          @item_window.process_cancel if Mouse.rclick? and Mouse.within?(rectttl)
        end
        #SKILL_WINDOW
        if @skill_window.active
          xx = 0
          yy = @help_window.height
          width = @skill_window.contents.width / 2
          hold_rect = []; temp = 2
          rectttl = Rect.new(xx, yy, @skill_window.contents.width, @skill_window.contents.height)
          rectcmA = Rect.new(Graphics.width / 2 - 50, @help_window.height - 12, 100, 24)
          rectcmB = Rect.new(Graphics.width / 2 - 50, Graphics.height - @actor_command_window.height - 12, 100, 24)
          for i in Range.new(0,@skill_window.item_max - 1)
                tempx = xx + OFS + width * (temp % 2)
                tempy = yy + OFS + 24 * ((temp / 2) - 1)
                hold_rect.push(Rect.new(tempx, tempy, width, WLH))
                temp += 1
          end
          @scroll = @skill_window.top_row + (@skill_window.top_row * 2 / 2)
          for i in Range.new(0,@skill_window.item_max - 1)
                next if hold_rect[i].nil?
                @skill_window.index = (i + @scroll) if Mouse.within?(hold_rect[i])
          end
          @skill_window.cursor_down if Mouse.within?(rectcmB) and Mouse.slowpeat
          @skill_window.cursor_up if Mouse.within?(rectcmA) and Mouse.slowpeat
          @skill_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
          @skill_window.process_cancel if Mouse.rclick? and Mouse.within?(rectttl)
        end
        #ENEMY_WINDOW
        if @enemy_window.active
          xx = Graphics.width - @enemy_window.width
          yy = Graphics.height - @enemy_window.height
          width = @enemy_window.contents.width / 2
          rectcm1 = Rect.new(xx + OFS, yy + OFS, width, WLH)
          rectcm2 = Rect.new(rectcm1.x + width, rectcm1.y, width, WLH)
          rectcm3 = Rect.new(rectcm1.x, rectcm1.y + 24, width, WLH)
          rectcm4 = Rect.new(rectcm1.x + width, rectcm3.y, width, WLH)
          rectcm5 = Rect.new(rectcm1.x, rectcm3.y + 24, width, WLH)
          rectcm6 = Rect.new(rectcm1.x + width, rectcm5.y, width, WLH)
          rectcm7 = Rect.new(rectcm1.x, rectcm5.y + 24, width, WLH)
          rectcm8 = Rect.new(rectcm1.x + width, rectcm7.y, width, WLH)
          rectttl = Rect.new(rectcm1.x, rectcm1.y, width * 2, WLH * 4)
          @enemy_window.index = 0 if Mouse.within?(rectcm1)
          @enemy_window.index = 1 if Mouse.within?(rectcm2) and !$game_troop.alive_members[1].nil?
          @enemy_window.index = 2 if Mouse.within?(rectcm3) and !$game_troop.alive_members[2].nil?
          @enemy_window.index = 3 if Mouse.within?(rectcm4) and !$game_troop.alive_members[3].nil?
          @enemy_window.index = 4 if Mouse.within?(rectcm5) and !$game_troop.alive_members[4].nil?
          @enemy_window.index = 5 if Mouse.within?(rectcm6) and !$game_troop.alive_members[5].nil?
          @enemy_window.index = 6 if Mouse.within?(rectcm7) and !$game_troop.alive_members[6].nil?
          @enemy_window.index = 7 if Mouse.within?(rectcm8) and !$game_troop.alive_members[7].nil?
          @enemy_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
          @enemy_window.process_cancel if Mouse.rclick? and Mouse.within?(rectttl)
        end
        #ACTOR_COMMAND_WINDOW
        if @actor_command_window.active
          xx = Graphics.width - @actor_command_window.width
          yy = Graphics.height - @actor_command_window.height
          width = @actor_command_window.contents.width
          rectcm1 = Rect.new(xx + OFS, yy + OFS, width, WLH)
          rectcmA = Rect.new(rectcm1.x, rectcm1.y - WLH, width, WLH)
          rectcm2 = Rect.new(rectcm1.x, rectcm1.y + WLH, width, WLH)
          rectcm3 = Rect.new(rectcm1.x, rectcm2.y + WLH, width, WLH)
          rectcm4 = Rect.new(rectcm1.x, rectcm3.y + WLH, width, WLH)
          rectcmB = Rect.new(rectcm1.x, rectcm4.y + WLH, width, WLH)
          rectttl = Rect.new(rectcm1.x, rectcm1.y, width, WLH * 4)
          @actor_command_window.cursor_up if Mouse.within?(rectcmA) and @actor_command_window.item_max > 4
          @actor_command_window.cursor_down if Mouse.within?(rectcmB) and @actor_command_window.item_max > 4
          @scroll = @actor_command_window.top_row
          @actor_command_window.index = (0 + @scroll) if Mouse.within?(rectcm1)
          @actor_command_window.index = (1 + @scroll) if Mouse.within?(rectcm2)
          @actor_command_window.index = (2 + @scroll) if Mouse.within?(rectcm3)
          @actor_command_window.index = (3 + @scroll) if Mouse.within?(rectcm4)
          @actor_command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
          @actor_command_window.process_cancel if Mouse.rclick? and Mouse.within?(rectttl)
        end
        #PARTY_COMMAND_WINDOW
        if @party_command_window.openness > 254
          xx = 0
          yy = Graphics.height - @party_command_window.height
          width = @party_command_window.contents.width
          rectcm1 = Rect.new(xx + OFS, yy + OFS, width, WLH)
          rectcm2 = Rect.new(rectcm1.x, rectcm1.y + WLH, width, WLH)
          rectttl = Rect.new(rectcm1.x, rectcm1.y, width, WLH * 2)
          @party_command_window.index = 0 if Mouse.within?(rectcm1)
          @party_command_window.index = 1 if Mouse.within?(rectcm2)
          @party_command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
        #END
   end
  end
end

class Window_Message < Window_Base
  def input_pause
        self.pause = true
        wait(10)
        Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) || (Mouse.lclick? if !SceneManager.scene_is?(Scene_Map))
        Input.update
        self.pause = false
  end
end


Спойлер Title/File:
Код:
#Mouse Title/File - Basic Mouse System Addon
#----------#
#Features: Adds basic mouse functionality to the Title screen and Save screen
#           Left click pretty much acts as the accept button
#           Right click pretty much acts as the cancel button
#
#Usage:   Plug and Play
#
#No Customization
#
#----------#
#-- Script by: V.M of D.T
#--- Same Terms as Basic Mouse System

class Scene_Title < Scene_Base
  def update
    super
    mouse_input
  end
  def mouse_input
    new_game_rect = Rect.new(@command_window.x + 12, @command_window.y + 12, @command_window.contents.width, 24)
    cont_rect = Rect.new(new_game_rect.x, new_game_rect.y + 24, new_game_rect.width, 24)
    shutdown_rect = Rect.new(cont_rect.x, cont_rect.y + 24, cont_rect.width, 24)
    rectttl = Rect.new(cont_rect.x, new_game_rect.y, cont_rect.width, 24*3)
    @command_window.index = 0 if Mouse.within?(new_game_rect)
    @command_window.index = 1 if Mouse.within?(cont_rect)
    @command_window.index = 2 if Mouse.within?(shutdown_rect)
    @command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
  end
end

class Scene_File < Scene_MenuBase
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    xx = 0
    yy = 56
    width = Graphics.width
    rectcm1 = Rect.new(xx, yy, width, savefile_height)
    rectcm2 = Rect.new(xx, yy + rectcm1.height, width, savefile_height)
    rectcm3 = Rect.new(xx, yy + rectcm1.height * 2, width, savefile_height)
    rectcm4 = Rect.new(xx, yy + rectcm1.height * 3, width, savefile_height)
    rectttl = Rect.new(xx, yy, width, rectcm1.height * 4)
    rectcmA = Rect.new(0, yy - 12, Graphics.width, 24)
    rectcmB = Rect.new(0, Graphics.height - 12, Graphics.width, 24)
    @scroll = self.top_index
    last_index = @index
    @index = (0 + @scroll) if Mouse.within?(rectcm1)
    @index = (1 + @scroll) if Mouse.within?(rectcm2)
    @index = (2 + @scroll) if Mouse.within?(rectcm3)
    @index = (3 + @scroll) if Mouse.within?(rectcm4)
    cursor_down(false) if Mouse.within?(rectcmB) and Mouse.slowpeat
    cursor_up(false) if Mouse.within?(rectcmA) and Mouse.slowpeat
    if @index != last_index
      Sound.play_cursor
      @savefile_windows[last_index].selected = false
      @savefile_windows[@index].selected = true
    end
    on_savefile_ok if Mouse.lclick? and Mouse.within?(rectttl)
    on_savefile_cancel if Mouse.rclick? and Mouse.within?(rectttl)
  end
end


Спойлер Menu:
Код:
#Mouse Menu - Basic Mouse System Addon
#----------#
#Features: Adds basic mouse functionality to the Menu and subjacent options
#           Left click pretty much acts as the accept button
#           Right click pretty much acts as the cancel button
#           Right click on map to pull it up
#
#Usage:   Plug and Play
#
#No Customization
#
#----------#
#-- Script by: V.M of D.T
#--- Same Terms as Basic Mouse System

class Scene_Map < Scene_Base
  alias mouse_update update
  def update
    mouse_update
    mouse_menu_input
  end
  def mouse_menu_input
    call_menu if Mouse.rclick? and !$game_map.interpreter.running?
  end
end

class Scene_Menu < Scene_MenuBase
  OFS = 12
  WLH = 24
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    if !@status_window.active
      hold_rect = []
      xx = @command_window.x + OFS
      yy = @command_window.y + OFS
      width = @command_window.width
      rectttl = Rect.new(xx, yy, width, WLH * 7)
      for i in Range.new(0, 6)
        hold_rect.push(Rect.new(xx, yy, width, WLH))
        yy += WLH
      end
      for i in Range.new(0, 6)
        @command_window.index = i if Mouse.within?(hold_rect[i])
      end
      @command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @command_window.process_cancel if Mouse.rclick?
    else
      hold_rect = []
      xx = @status_window.x + OFS
      yy = @status_window.y + OFS
      width = @status_window.width
      rectttl = Rect.new(xx, yy, width, @status_window.contents.height)
      for i in Range.new(0, $game_party.members.size - 1)
        hold_rect.push(Rect.new(xx, yy, width, @status_window.item_height))
        yy += @status_window.item_height
      end
      for i in Range.new(0, $game_party.members.size - 1)
        @status_window.index = i if Mouse.within?(hold_rect[i])
      end
      @status_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @status_window.process_cancel if Mouse.rclick? and Mouse.within?(rectttl)
    end
  end
end
class Scene_Item
  OFS = 12
  WLH = 24
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    if @category_window.active
      hold_rect = []
      xx = @category_window.x + OFS
      yy = @category_window.y + OFS
      width = @category_window.contents.width / 4
      rectttl = Rect.new(xx, yy, width * 4, @category_window.contents.height)
      for i in Range.new(0,3)
        hold_rect.push(Rect.new(xx, yy, width, @category_window.contents.height))
        xx += width
      end
      for i in Range.new(0,3)
        @category_window.index = i if Mouse.within?(hold_rect[i])
      end
      @category_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @category_window.process_cancel if Mouse.rclick?
    elsif @item_window.active
      xx = @item_window.x + OFS
      yy = @item_window.y + OFS
      width = @item_window.contents.width / 2
      hold_rect = []; temp = 2
      smax = [@item_window.item_max, ((@item_window.height - 24) / WLH) * 2].min
      rectttl = Rect.new(xx, yy, @item_window.contents.width, @item_window.contents.height)
      rectcmA = Rect.new(@item_window.width / 2 - 50, yy - 12, 100, 24)
      rectcmB = Rect.new(@item_window.width / 2 - 50, yy - 12 + @item_window.height, 100, 24)
      for i in Range.new(0,smax - 1)
        tempx = xx + width * (temp % 2)
        tempy = yy + 24 * ((temp / 2) - 1)
        hold_rect.push(Rect.new(tempx, tempy, width, WLH))
        temp += 1
      end
      @scroll = @item_window.top_row + (@item_window.top_row * 2 / 2)
      for i in Range.new(0,@item_window.item_max - 1)
        next if hold_rect[i].nil?
        @item_window.index = (i + @scroll) if Mouse.within?(hold_rect[i])
      end
      @item_window.cursor_down if Mouse.within?(rectcmB) and Mouse.slowpeat
      @item_window.cursor_up if Mouse.within?(rectcmA) and Mouse.slowpeat
      @item_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @item_window.process_cancel if Mouse.rclick?  
    elsif @actor_window.active
      hold_rect = []
      xx = @actor_window.x + OFS
      yy = @actor_window.y + OFS
      width = @actor_window.width
      rectttl = Rect.new(xx, yy, width, @actor_window.contents.height)
      for i in Range.new(0, $game_party.members.size - 1)
        hold_rect.push(Rect.new(xx, yy, width, @actor_window.item_height))
        yy += @actor_window.item_height
      end
      for i in Range.new(0, $game_party.members.size - 1)
        @actor_window.index = i if Mouse.within?(hold_rect[i])
      end
      @actor_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @actor_window.process_cancel if Mouse.rclick?
    end
  end
end
class Scene_Skill
  OFS = 12
  WLH = 24
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    if @command_window.active
      hold_rect = []
      xx = @command_window.x + OFS
      yy = @command_window.y + OFS
      width = @command_window.contents.width
      rectttl = Rect.new(xx, yy, width, @command_window.contents.height)
      for i in Range.new(0,@command_window.item_max-1)
        hold_rect.push(Rect.new(xx, yy, width, WLH))
        yy += WLH
      end
      for i in Range.new(0,@command_window.item_max-1)
        @command_window.index = i if Mouse.within?(hold_rect[i])
      end
      @command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @command_window.process_cancel if Mouse.rclick?
    elsif @item_window.active
      xx = @item_window.x + OFS
      yy = @item_window.y + OFS
      width = @item_window.contents.width / 2
      hold_rect = []; temp = 2
      smax = [@item_window.item_max, ((@item_window.height - 24) / WLH) * 2].min
      rectttl = Rect.new(xx, yy, @item_window.contents.width, @item_window.contents.height)
      rectcmA = Rect.new(@item_window.width / 2 - 50, yy - 12, 100, 24)
      rectcmB = Rect.new(@item_window.width / 2 - 50, yy - 12 + @item_window.height, 100, 24)
      for i in Range.new(0,smax - 1)
        tempx = xx + width * (temp % 2)
        tempy = yy + 24 * ((temp / 2) - 1)
        hold_rect.push(Rect.new(tempx, tempy, width, WLH))
        temp += 1
      end
      @scroll = @item_window.top_row + (@item_window.top_row * 2 / 2)
      for i in Range.new(0,@item_window.item_max - 1)
        next if hold_rect[i].nil?
        @item_window.index = (i + @scroll) if Mouse.within?(hold_rect[i])
      end
      @item_window.cursor_down if Mouse.within?(rectcmB) and Mouse.slowpeat
      @item_window.cursor_up if Mouse.within?(rectcmA) and Mouse.slowpeat
      @item_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @item_window.process_cancel if Mouse.rclick?  
    elsif @actor_window.active
      hold_rect = []
      xx = @actor_window.x + OFS
      yy = @actor_window.y + OFS
      width = @actor_window.width
      rectttl = Rect.new(xx, yy, width, @actor_window.contents.height)
      for i in Range.new(0, $game_party.members.size - 1)
        hold_rect.push(Rect.new(xx, yy, width, @actor_window.item_height))
        yy += @actor_window.item_height
      end
      for i in Range.new(0, $game_party.members.size - 1)
        @actor_window.index = i if Mouse.within?(hold_rect[i])
      end
      @actor_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @actor_window.process_cancel if Mouse.rclick?
    end
  end
end
class Scene_Equip
  OFS = 12
  WLH = 24
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    if @command_window.active
      hold_rect = []
      xx = @command_window.x + OFS
      yy = @command_window.y + OFS
      width = @command_window.width / 3
      rectttl = Rect.new(xx, yy, width * 3, @command_window.contents.height)
      for i in Range.new(0, 2)
        hold_rect.push(Rect.new(xx, yy, width, WLH))
        xx += width
      end
      for i in Range.new(0, 2)
        @command_window.index = i if Mouse.within?(hold_rect[i])
      end
      @command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @command_window.process_cancel if Mouse.rclick?
    elsif @slot_window.active
      hold_rect = []
      xx = @slot_window.x + OFS
      yy = @slot_window.y + OFS
      width = @slot_window.width
      rectttl = Rect.new(xx, yy, width, @slot_window.contents.height)
      for i in Range.new(0, 4)
        hold_rect.push(Rect.new(xx, yy, width, WLH))
        yy += WLH
      end
      for i in Range.new(0, 4)
        @slot_window.index = i if Mouse.within?(hold_rect[i])
      end
      @slot_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @slot_window.process_cancel if Mouse.rclick?
    elsif @item_window.active
      xx = @item_window.x + OFS
      yy = @item_window.y + OFS
      width = @item_window.contents.width / 2
      hold_rect = []; temp = 2
      smax = [@item_window.item_max, ((@item_window.height - 24) / WLH) * 2].min
      rectttl = Rect.new(xx, yy, @item_window.contents.width, @item_window.contents.height)
      rectcmA = Rect.new(@item_window.width / 2 - 50, yy - 12, 100, 24)
      rectcmB = Rect.new(@item_window.width / 2 - 50, yy - 12 + @item_window.height, 100, 24)
      for i in Range.new(0,smax - 1)
        tempx = xx + width * (temp % 2)
        tempy = yy + 24 * ((temp / 2) - 1)
        hold_rect.push(Rect.new(tempx, tempy, width, WLH))
        temp += 1
      end
      @scroll = @item_window.top_row + (@item_window.top_row * 2 / 2)
      for i in Range.new(0,@item_window.item_max - 1)
        next if hold_rect[i].nil?
        @item_window.index = (i + @scroll) if Mouse.within?(hold_rect[i])
      end
      @item_window.cursor_down if Mouse.within?(rectcmB) and Mouse.slowpeat
      @item_window.cursor_up if Mouse.within?(rectcmA) and Mouse.slowpeat
      @item_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
      @item_window.process_cancel if Mouse.rclick?  
    end
  end
end
class Scene_Status
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    @status_window.process_pagedown if Mouse.lclick?
    @status_window.process_cancel if Mouse.rclick?
  end
end
class Scene_End
  OFS = 12
  WLH = 24
  alias mouse_update update
  def update
    mouse_update
    mouse_input
  end
  def mouse_input
    hold_rect = []
    xx = @command_window.x + OFS
    yy = @command_window.y + OFS
    width = @command_window.width
    rectttl = Rect.new(xx, yy, width, @command_window.contents.height)
    for i in Range.new(0, 2)
      hold_rect.push(Rect.new(xx, yy, width, WLH))
      yy += WLH
    end
    for i in Range.new(0, 2)
      @command_window.index = i if Mouse.within?(hold_rect[i])
    end
    @command_window.process_ok if Mouse.lclick? and Mouse.within?(rectttl)
    @command_window.process_cancel if Mouse.rclick?
  end
end