Advertisement
mjshi

Fullscreen++ Alt+Enter Fix

Oct 9th, 2017
1,935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.65 KB | None | 0 0
  1. #===============================================================================
  2. # Chainsawkitten's Disable F1, Alt+Enter, F12 v1.1
  3. #-------------------------------------------------------------------------------
  4. # Modified by mjshi to support for alt enter fullscreening
  5. #
  6. # Requires Full Input Keyboard by Cidiomar R. Dias Junior:
  7. # http://himeworks.com/2013/07/full-input-keyboard/
  8. #
  9. # Requires Fullscreen++:
  10. # http://pastebin.com/raw.php?i=kc1hzBek
  11. #
  12. #------------------------------------------------------------------------------
  13. # ** Make sure the Full Input Keyboard script is placed before this one! **
  14. #     It doesn't matter how much before, it just has to be above this.
  15. #==============================================================================
  16.  
  17. Win32API.new("System/F1AltEnterF12", "hook", "III", "").call(
  18.   0, # Disable F1?       0 = no, 1 = yes
  19.   0, # Disable F12?      0 = no, 1 = yes
  20.  
  21.   #-----------------------------------------------------------------------------
  22.   # IMPORTANT! The value below *needs* to be 1 or your game will freeze when
  23.   # you try to fullscreen.
  24.   1  # Disable AltEnter? 0 = no, 1 = yes
  25. )
  26.  
  27. module Input
  28.   class << self
  29.     unless self.method_defined?(:input_update)
  30.       alias_method(:input_update, :update)
  31.     end
  32.  
  33.     def update
  34.       input_update
  35.      
  36.       #-------------------------------------------------------------------------
  37.       # Launch Fullscreen++ if the alt key is held down and enter key is
  38.       # triggered or vice versa
  39.       Graphics.toggle_fullscreen if (Input.press?(:ALT) && Input.trigger?(:RETURN)) || (Input.trigger?(:ALT) && Input.press?(:RETURN))
  40.     end
  41.   end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement