• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Norman Barrows

disable windows key - hook or message pump?

7 posts in this topic

As far as I know it has to be done as a keyboard hook.  ALT and F10 can be handled with the usual message pump though.

Edited by Nypyren
0

Share this post


Link to post
Share on other sites

Why not just pause your application when the user switches?

 

Even the Elder Scrolls Online beta (which can't be paused, obviously) was quite happy switching between apps, which can be really useful from a users/developers perspective.

Edited by mark ds
0

Share this post


Link to post
Share on other sites

I have never found an alternative to keyboard hook - although i have never wanted to disable it per-se, just disable its usual function and make it available as a regular key for keybinds.

 

However, as frob mentioned - have an easy to access option for disabling the override.

 

OT: Similarily, might want to consider optionally disabling sticky keys etc whenever your game has focus (you can do that with SystemParametersInfo). Specifically: STICKYKEYS, TOGGLEKEYS and FILTERKEYS.

0

Share this post


Link to post
Share on other sites


Why not just pause your application when the user switches?

 


There are some games where players are rapidly pounding on the keys around the start button and accidentally bump the key.

 

that's why.  <g>.

 

Caveman does support full task switching now. Even gets the windows mouse cursor correct, which Skyrim doesn't. 

 

but its also a game where one can accidentally hit the windows button (start menu button) in the heat of combat. 

 


You can accomplish the technical side by consuming the WM_SYSKEYDOWN and WM_SYSKEYUP events that correspond to the specific event you want to prevent. In addition to alt+tab, you may want to capture VK_LWIN, VK_RWIN, and VK_APPS.

 

I suspected as much.    why mess with the low level hook, when you already have to process the incoming messages anyway, and can just intercept them there.

 

I do not plan to disable alt-tab. only the windows key. the apps key would probably be a good idea too. 

 


OT: Similarily, might want to consider optionally disabling sticky keys etc whenever your game has focus (you can do that with SystemParametersInfo). Specifically: STICKYKEYS, TOGGLEKEYS and FILTERKEYS.

 

yes, i found that too during my online search. in that case, i find its VERY rare that one accidentally triggers sticky keys. if one does, a menu pops up, you simply turn them off, then alt-tab back to the game. i don't think this rare special case needs anything more than that. also, users who actually use such features should be used to having to turn them off to play games. 

 

i'd prefer to disable as little as possible - leaving it to the user to explicitly disable incompatible software (like sticky keys) BEFORE launching the game.

 

but things like the windows key could really use a disable option - its just too easy to press it accidentally in combat - depending on keyboard layout of course.

 

here's MS's official web page on the subject....

 

Disabling Shortcut Keys in Games:

http://msdn.microsoft.com/en-us/library/windows/desktop/ee416808(v=vs.85).aspx

 

but this only describes the hook method, and the stickykeys etc method. the message intercept method is described in various threads about the subject here on gamedev.

0

Share this post


Link to post
Share on other sites

I would be weary of capturing any default system functionality in an attempt to disable or prevent it's actions.  I've played games that have done just this and find the behavior intrusive and having no merit.  Users should be capable of using their systems as they see fit and it should be their responsibility to make intelligent decisions about bindings, button usage, etc that maximizes their own play style that they find effective; not the game itself.

 

The best middle ground IMO would be that if you wish to offer such a feature, be sure to make it something that the user can toggle ON/OFF depending on their preferences in some game menu screen.  This way, those who fall into the category of hitting the button mid-combat have a reprieve to their mistake while those who want to keep the default button functionality available can do so.

Edited by crancran
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0