gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfxgfx
 
Members, please note that our guidelines are located here.
 
gfx gfx
gfx
484586 Posts in 28410 Topics by 2464 Members - Latest Member: austinrobert July 10, 2020, 04:24:41 PM
*
gfx* Home | Help | Calendar | Login | Register | gfx
gfx
The Gaming Universe  |  The Archives  |  Archived Projects  |  Open Zelda  |  OZ Help (Moderator: red_team316)  |  Disable Alt Key Pause
gfx
gfxgfx
 

Author Topic: Disable Alt Key Pause  (Read 2529 times)

Offline Khatuni

  • Executive
  • ***
  • Posts: 1,007
    • View Profile
Disable Alt Key Pause
« on: May 16, 2011, 05:58:07 PM »
Usually in Windows, when you press Alt in a program, it calls the menu bar and pauses the program. Now I removed the menu bar in OZ, but Alt still pauses the game, even in fullscreen mode. How would I disable this, so that I can use Alt as a regular control key?

Offline KingOfHumans

  • Messiah
  • ******
  • Posts: 17,866
    • View Profile
Re: Disable Alt Key Pause
« Reply #1 on: May 16, 2011, 08:24:39 PM »
There's no Alt anywhere in the OpenZelda.rc file, right?

Offline Aliem

  • Ț̼͍̩̹̥̞̩̖͝ ̺̰̟͝s̸҉̜̜̘̥̥̤̬͓͔̰͔̩ͅ ̴̡̭̪͍͇̕c̦̀̀͡ͅ&
  • Advisor
  • Messiah
  • *
  • Posts: 13,311
  • Oh hai Mark
    • View Profile
Re: Disable Alt Key Pause
« Reply #2 on: May 17, 2011, 03:01:27 AM »
This might be presumptuous of me, but why not use another key?

Offline Khatuni

  • Executive
  • ***
  • Posts: 1,007
    • View Profile
Re: Disable Alt Key Pause
« Reply #3 on: May 17, 2011, 05:53:02 AM »
This might be presumptuous of me, but why not use another key?

It's not that I need Alt for a certain thing, but I want all keyboard keys to be available for the player, just like in Snes9x and Project64.

There's no Alt anywhere in the OpenZelda.rc file, right?

Nope, the only "alt" in my source is in amx.c.

Edit: Luke sent me this code, to use in MainWndProc:

   case WM_SYSKEYDOWN:
      return 0;
      break;

But it disables the other keyboard keys, so that won't work.
« Last Edit: May 17, 2011, 06:26:58 AM by Khatuni »

Offline KingOfHumans

  • Messiah
  • ******
  • Posts: 17,866
    • View Profile
Re: Disable Alt Key Pause
« Reply #4 on: May 17, 2011, 10:41:03 AM »
What does it to in the amx.c? (I'll look it up)
Maybe what Luke suggested will help narrow down the problem.

edit: I believe Luke's idea will work. Try placing his code after the keys check.
I'm not 100% sure yet but I think the alt key is being sent here.

return DefWindowProc(hWnd, msg, wParam, lParam);

So I'm looking up the .h file to see if this is true. So like I said, try it after the keys function.
« Last Edit: May 17, 2011, 11:03:11 AM by KingOfHumans »

Offline Khatuni

  • Executive
  • ***
  • Posts: 1,007
    • View Profile
Re: Disable Alt Key Pause
« Reply #5 on: May 17, 2011, 02:03:24 PM »
amx.c handles the Small scripts, so that's not the problem.
You mean after the key check, like this?:
Code: [Select]
case WM_KEYUP:
g_pGame->m_fKeys[wParam] = false;
g_pGame->m_fkey = 0;
break;
case WM_KEYDOWN:
g_pGame->m_fKeys[wParam] = true;
g_pGame->m_fkey = wParam;
break;
        case WM_SYSKEYDOWN:
                return 0;
                break;

Doesn't matter where I put the WM_SYSKEYDOWN, it can't be used in combo with other keys.

I don't think the solution should be in MainWndProc. It's not a key check issue, it's the function of Alt/F10 that runs after the key has been checked. That function call needs to be disabled.

Edit: After reading through some articles on the internet, I think this is really a standard Windows thing. There are ways to work around it, but I wanted to be able to still use Alt as a regular key, not disabling it completely. Well...  whatever.
« Last Edit: May 17, 2011, 02:15:47 PM by Khatuni »

Offline KingOfHumans

  • Messiah
  • ******
  • Posts: 17,866
    • View Profile
Re: Disable Alt Key Pause
« Reply #6 on: May 17, 2011, 02:27:24 PM »
I did a little more searching and found two pages that may help.
http://cboard.cprogramming.com/windows-programming/61896-disabling-alt-key.html

http://www.codeproject.com/KB/winsdk/AntonioWinLock.aspx

It most likely has to do with windows.h as most programs use it.

btw 0x20000000 is how you write hex, works for OZ to.
I don't get it completely in this case since it converts to 536870912.
You can use my "native ToHex(val, out[]);" to understand hex a bit more. Especially that & symbol.
« Last Edit: May 17, 2011, 02:30:58 PM by KingOfHumans »

Offline Khatuni

  • Executive
  • ***
  • Posts: 1,007
    • View Profile
Re: Disable Alt Key Pause
« Reply #7 on: May 17, 2011, 04:51:32 PM »
I'm not going to change windows.h... One mistake and it might screw up my whole computer.  :p

Offline Aliem

  • Ț̼͍̩̹̥̞̩̖͝ ̺̰̟͝s̸҉̜̜̘̥̥̤̬͓͔̰͔̩ͅ ̴̡̭̪͍͇̕c̦̀̀͡ͅ&
  • Advisor
  • Messiah
  • *
  • Posts: 13,311
  • Oh hai Mark
    • View Profile
Re: Disable Alt Key Pause
« Reply #8 on: May 17, 2011, 10:56:08 PM »
Quote
lukex> Can some inform Khatuni that WM_KEYDOWN/WM_KEYUP in the switch can be copied for WM_SYSKEYDOWN/WM_SYSKEYUP so alt key can be used. Thanks.

Offline Khatuni

  • Executive
  • ***
  • Posts: 1,007
    • View Profile
Re: Disable Alt Key Pause
« Reply #9 on: May 18, 2011, 07:28:06 AM »
I get it now. Give him my thanks if you speak him. Hotmail blocks his account for me.

Code: [Select]
case WM_KEYUP:
g_pGame->m_fKeys[wParam] = false;
g_pGame->m_fkey = 0;
break;
case WM_KEYDOWN:
g_pGame->m_fKeys[wParam] = true;
g_pGame->m_fkey = wParam;
break;
case WM_SYSKEYUP:
g_pGame->m_fKeys[wParam] = false;
g_pGame->m_fkey = 0;
break;
case WM_SYSKEYDOWN:
g_pGame->m_fKeys[wParam] = true;
g_pGame->m_fkey = wParam;
return 0;
break;

Offline KingOfHumans

  • Messiah
  • ******
  • Posts: 17,866
    • View Profile
Re: Disable Alt Key Pause
« Reply #10 on: May 18, 2011, 10:14:39 AM »
So you also removed the function CheckKeysDown/Up I see.
Anyways, glad you got it working.

Offline Khatuni

  • Executive
  • ***
  • Posts: 1,007
    • View Profile
Re: Disable Alt Key Pause
« Reply #11 on: May 18, 2011, 12:31:26 PM »
Those functions are useless since they are only returned there (in the CV).

The Gaming Universe  |  The Archives  |  Archived Projects  |  Open Zelda  |  OZ Help (Moderator: red_team316)  |  Disable Alt Key Pause
 

gfxgfx
gfx
SMF 2.0.17 | SMF © 2019, Simple Machines Page created in 0.205 seconds with 22 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!