CINNAMON'S PROFILE

Hey! I'm a game developer. :) I love traveling, cats and games with unique stories that make you think~.
Unraveled: Tale of the S...
Based on real events, adventure through a child’s imagination as she seeks out her lost family. Music by Secret of Mana's Hiroki Kikuta

Search

Filter

Trailer & Steam Greenlight!

Thank you! :) I already have 2 games on Steam, but we'd like to publish this one ourselves to make up for the high production costs.

How to disable Alt + Enter?

Omg you're a genius, thank you so much! I can finally re-activate Alt + Tab and Alt + F4! I know that irked quite a few players before (including me, lol).

Time to update all my previous games. xD

How to disable Alt + Enter?

Yup, I figured as much. :D So if it's not 0 it's full screen and if it IS 0 it's windowed?

How to disable Alt + Enter?

Wow, okay, something is definitely happening now! :D

I'm getting big random integers if the game is in full screen and a 0 if it's windowed. Is that correct?

So basically I can use this whenever the player enters the menu / exits the game. Check the def. If it returns '0' the player has it on windowed mode, if it returns ANY variable other than 0, the player has it in full screen? And this method is pretty reliable? ^_^

How to disable Alt + Enter?

@Cherry: Thank you! That looks really interesting. Would you happen to know if it can work for XP as well? I'm getting an RGSS error for the very first line. Possibly because of the %w(p p p p l p). Looking at my other Win32API calls in the game, they all have the third variable in the format of ''.

e.g.

'LPLPPP'
'L'
etc.

@orochii: Thank you for the tip! But isn't that against the terms of agreement with RPG Maker? I work on commercial games so I don't think I'm technically allowed to edit the *.dll?

And if I am allowed to change it, if someone who plays my game runs the game, would it use the dll provided in the game folder by me or the one installed on their computer? If it uses the one installed instead of the one provided by me, then it loses its function. ^^;

Edit: Okay, so the problem was that I can't have the variables start with a capital letter. The %w is fine apparently? Changed it into this:

    # Get API functions and constants
getPrivateProfileStringA = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'L')
findWindow = Win32API.new('user32','FindWindow', %w(p p), 'L')
getWindowLong = Win32API.new('user32', 'GetWindowLong', %w(L l), 'L')
gWL_STYLE = 16
wS_POPUP = 0x80000000

# Get game title
game_name = "\0" * 256
getPrivateProfileStringA.call('Game', 'Title', '', game_name, 255, ".\\Game.ini")
game_name.delete!("\0")

# Find game window
window_handle = findWindow.call('RGSS Player', game_name)

# Get window style
window_style = getWindowLong.call(window_handle, gWL_STYLE)

p window_style

# If WS_POPUP style is set, the game is fullscreen
window_style & wS_POPUP

game_name and window_handle seem to work perfectly, window_style constantly returns '0', though. :/

How to disable Alt + Enter?

@Liberty: Because, like I said, I need to keep track of whether the game is in full screen or windowed mode for various reasons (one being that the game should start in the same resolution that it was closed in). If I keep Alt + Enter, I don't know of a way to keep track of it. :/ You can hit Alt + Enter at moments where the game isn't actually functioning, but it will still change resolution. Whereas if it's done through a hotkey that manually presses Alt + Enter through script, it can only be done when the game is active. Does that make sense? ^^;

@Cherry: Is there another way of checking what size the game is in?

As of right now F11 presses Alt + Enter indirectly and at the same time adjusts a variable to match the full screen / windowed mode.

How to disable Alt + Enter?

I need to keep track of the game's resolution, so I changed Alt + Enter into a hotkey (F11).

How to disable Alt + Enter?

I tried that, but at that point it already triggers Alt + Enter. Doing that basically means "if Alt + Enter is already pressed". ^_^;

The script posted above basically disables any other key once Alt is pressed by filling it with a blank (keys.call(18, 0, 2, 0)).

I just don't have enough knowledge to figure out how to fix this so Alt + Tab and Alt + F4 can be used. :/

How to disable Alt + Enter?

So I'm using this script that disables Alt + Enter, but in doing so disables any combination with the alt key -- including Alt + Tab and Alt + F4. Is it possible to ONLY disable Alt + Enter so that the others are still usable? Here's the code:

# Disable ALT-ENTER

module Input
class << self
unless self.method_defined?(:input_update)
alias_method(:input_update, :update)
end
def update
input_update
if Input.press?(Input::ALT)
#unless Keys.trigger?(Keys::F4)
keys = Win32API.new('user32', 'keybd_event', 'LLLL', '')
keys.call(18, 0, 2, 0)
#end
end
end
end
end

Extended Version Screenshots

Thank you! :D