Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Disabling Full Screen Toggle REQUEST

howdy ho,

my problem is thus, i have an intro cut scene which i am fairly satisfied with .. however, if a person toggles from full screen to the minimized screen during the intro (auto full at game start) ... then the intro cut gets out of sync and starts to look like total crap

Is There Some Way to Temporarily DISABLE the Screen Toggle Function without removing the ability to press ESC and skip the intro ?

please.  thank you.
 
ok... so i found this usefull little snippet:

(hex variant)

module Input
  class << self
    alias altkey_update update
    KBE = Win32API.new('user32', 'keybd_event', 'LLLL', '')
    def update
      altkey_update
      KBE.call(0x12, 0, 2, 0)
    end
  end
end

which works very well except for one thing, it only disables the Left ALT+Enter and not the Right ALT+Enter...   can anyone modify this so that it disables both?

the other script that i found still allows the toggle in the first place, it just kicks them back to the other mode after a delay, but i want to prevent the toggle in the first place altogher.   Note, the game begins in full screen mode.   and the above code works with it and does prevent the left alt.enter combo, but not the right.

Please and thanks if you can figure this out.

(Placed above MAIN and below everything else.)
and since i've come to the conclusion that its probably a script related problem/correction, this is probably suppose to be in the script request area, but i didn't know that when first posting.

(EDIT) ... and here is the 'ascii' version if this helps..

module Input
  class << self
    alias altkey_update update
    def update
      altkey_update
      Win32API.new('user32', 'keybd_event', 'LLLL', '').call(18, 0, 2, 0)
    end
  end
end
 
I have no idea what the hell that translates to as a actual 'key' index, since its in bianary, but reading through the Aleworks Keys Module, LEFT_ALT is 164 and RIGHT_ALT is at 165. I wish I knew more about Win32API, because I'd be more help.
 

Zeriab

Sponsor

If they are right next to each other you can try using this
Code:
KBE.call(0x13, 0, 2, 0)
# or
KBE.call(0x11, 0, 2, 0)
Add it below the other call. No promises that it'll work.

@Kain: It's in hex not binary.
0x12 = 1*16^1 + 2*16^0 = 1*16 + 2 = 18

*hugs*
- Zeriab

Edit: Actually I think it won't work since 0x11 seems to be the CTRL key and 0x13 the pause key. At least accordingly to Microsoft's virtual key codes.
 
so i wonder if '7b' prevents f12 from being pressed... anways...

i saw something about 17, 18, 19, and 20 being 'control keys'... so i'll try the ascii variant with these... but if i don't comment further, it hasn't worked... and im still needing assistance :(

(EDIT) ... nope.  '18' works on the ascii variant to prevent the left Alt+Enter but not the right Alt+Enter...
17, 19, and 20 had no effect....  gah... i'd try going through a lot of numbers but some of them are like '7B' and such... blek.
 

Zeriab

Sponsor

No unfortunately not. '7b' will not prevent f12 from being pressed. If you are using RMVX then I am afraid you are out of luck on preventing F12 from being pressed.
If you are using RMXP then you can use this snippet:
Code:
#=============================================================================
# ** Reset class (because it won't be defined until F12 is pressed otherwise)
#=============================================================================
class Reset < Exception
  
end
#=============================================================================
# ** Module Graphics
#=============================================================================
module Graphics
  class << self
    #-------------------------------------------------------------------------
    # * Aliases Graphics.update and Graphics.transition
    #-------------------------------------------------------------------------
    unless self.method_defined?(:zeriab_f12_removal_update)
      alias_method(:zeriab_f12_removal_update, :update)
      alias_method(:zeriab_f12_removal_transition, :transition)
    end
    def update(*args)
      done = false
      # Keep trying to do the update
      while !done
        begin
          zeriab_f12_removal_update(*args)
          done = true
        rescue Reset
          # Do nothing
        end
      end
    end
    def transition(*args)
      done = false
      # Keep trying to do the transition
      while !done
        begin
          zeriab_f12_removal_transition(*args)
          done = true
        rescue Reset
          # Do nothing
        end
      end
    end
  end
end

Note that if you want to use the numbers as shown on the page put a 0x in front. 0x7B for example.

Good luck getting it to work.
*hugs*
- Zeriab
 
strangely, on the ascii variant you can use the number 18, 164 or 165 ... all to prevent left Alt+Enter... but not right Alt+Enter.  i even tryed using 'vg..'s' Key Module to no effect... though all i did was place the script.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top