unless $_Start
$_Start = Win32API.new("BackgroundRunning","Start",'V','L')
$_Stop = Win32API.new("BackgroundRunning","Stop",'V','L')
$_OnFocus = Win32API.new("BackgroundRunning","OnFocus",'V','L')
$_Start.call
module Input
InputUpdate = method :update
InputTrigger = method :trigger?
InputPress = method :press?
InputRepeat = method :repeat?
InputDir4 = method :dir4
InputDir8 = method :dir8
def self.update
InputUpdate.call if $_OnFocus.call != 0
end
def self.trigger?(num)
return $_OnFocus.call != 0 ? InputTrigger.call(num) : false
end
def self.press?(num)
return $_OnFocus.call != 0 ? InputPress.call(num) : false
end
def self.repeat?(num)
return $_OnFocus.call != 0 ? InputRepeat.call(num) : false
end
def self.dir4
return $_OnFocus.call != 0 ? InputDir4.call : 0
end
def self.dir8
return $_OnFocus.call != 0 ? InputDir8.call : 0
end
end
end
unless $_Start
$_Start = Win32API.new("BackgroundRunning","Start",'V','L')
$_Stop = Win32API.new("BackgroundRunning","Stop",'V','L')
$_OnFocus = Win32API.new("BackgroundRunning","OnFocus",'V','L')
$_Start.call
module Input
InputUpdate = method :update
InputTrigger = method :trigger?
InputPress = method :press?
InputRepeat = method :repeat?
InputDir4 = method :dir4
InputDir8 = method :dir8
def self.update
InputUpdate.call if $_OnFocus.call != 0
end
def self.trigger?(num)
return $_OnFocus.call != 0 ? InputTrigger.call(num) : false
end
def self.press?(num)
return $_OnFocus.call != 0 ? InputPress.call(num) : false
end
def self.repeat?(num)
return $_OnFocus.call != 0 ? InputRepeat.call(num) : false
end
def self.dir4
return $_OnFocus.call != 0 ? InputDir4.call : 0
end
def self.dir8
return $_OnFocus.call != 0 ? InputDir8.call : 0
end
end
end