Mirage Source
http://miragesource.net/forums/

[Fix] Fixing input
http://miragesource.net/forums/viewtopic.php?f=183&t=6054
Page 1 of 55

Author:  Nean [ Tue Jul 28, 2009 8:10 am ]
Post subject:  [Fix] Fixing input

Wrote this up for RootSource on OGC, figured you guys could benefit from it?

Nean wrote:
I just spent the last two and a half hours working on this, so somebody better appreciate it. For spending so long, it's a very few lines of code. Anyways here goes

Add:
Code:
Public Declare Function GetForegroundWindow Lib "user32" () As Long
in ModInput

Then replace:
Code:
Call CheckInputKeys ' Check which keys were pressed


With:
Code:
        If GetForegroundWindow() = frmMainGame.hwnd Then
            Call CheckInputKeys ' Check which keys were pressed
        End If


Voila, done. Now it only responds if the current window is RootSource

Author:  Robin [ Tue Jul 28, 2009 10:44 am ]
Post subject:  Re: [Fix] Fixing input

I rated this topic:

Image Image Image Image Image

Good job.

Author:  Nean [ Tue Jul 28, 2009 6:55 pm ]
Post subject:  Re: [Fix] Fixing input

DFA wrote:
fully tested? wow if it works right
the best thing i've found was a pretty lengthy module that checks if a window has focus


Haha yeah, I spent two hours alternating writing functions/using booleans trying to determine if the window had focus, and then I stumbled across a GetActiveWindow API, but that didn't work. Another thirty minutes of research, trying to figure it out lead me to the GetForeGroundWindow API which worked flawlessly.

Author:  James [ Wed Jul 29, 2009 12:49 am ]
Post subject:  Re: [Fix] Fixing input

Good to see some leakage from OGC here. :3

Author:  James [ Wed Jul 29, 2009 4:27 am ]
Post subject:  Re: [Fix] Fixing input

Fail how? it works with only a few lines of code to fix a mistake you made.

Author:  Robin [ Wed Jul 29, 2009 12:49 pm ]
Post subject:  Re: [Fix] Fixing input

James wrote:
Fail how? it works with only a few lines of code to fix a mistake you made.


lol, Dmitry got burned.

Author:  Nean [ Wed Jul 29, 2009 2:07 pm ]
Post subject:  Re: [Fix] Fixing input

Wait, so this is unsatisfactory? Elaborate.

Author:  Matt [ Wed Jul 29, 2009 5:01 pm ]
Post subject:  Re: [Fix] Fixing input

Lol. DFA was kidding, he was just mad you fixed something he broke. :P

Author:  Nean [ Wed Jul 29, 2009 7:42 pm ]
Post subject:  Re: [Fix] Fixing input

Damn, I need to stop posting drunk. I don't figure these things out.

Author:  Robin [ Wed Jul 29, 2009 8:54 pm ]
Post subject:  Re: [Fix] Fixing input

Nean wrote:
Damn, I need to stop posting drunk. I don't figure these things out.


Dmitry is high on crack. I never understands anything.

Author:  Robin [ Fri Jul 31, 2009 10:37 am ]
Post subject:  Re: [Fix] Fixing input

Added it to Silverdale. Modded it a bit to allow game input on several forms, but it works like a charm.

+1 rep.

Author:  James [ Fri Jul 31, 2009 6:27 pm ]
Post subject:  Re: [Fix] Fixing input

DFA wrote:
i was totally gonna try it with my DirectInput8 system last night, had the page open and everything...then got distracted ><


Happens to the best of us.

Author:  wanai [ Wed Dec 01, 2021 9:17 am ]
Post subject:  Re: [Fix] Fixing input

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтsemiasphalticfluxсайтсайтсайт
сайтсайтсайтсайтсайтсайтhttp://taskreasoning.ruсайтсайтсайтинфосайтсайтtuchkasсайтсайт

Author:  wanai [ Fri Jan 07, 2022 6:07 am ]
Post subject:  Re: [Fix] Fixing input

Econ

Author:  wanai [ Fri Jan 07, 2022 6:08 am ]
Post subject:  Re: [Fix] Fixing input

115.9

Author:  wanai [ Fri Jan 07, 2022 6:09 am ]
Post subject:  Re: [Fix] Fixing input

Bett

Author:  wanai [ Fri Jan 07, 2022 6:10 am ]
Post subject:  Re: [Fix] Fixing input

Bett

Author:  wanai [ Fri Jan 07, 2022 6:11 am ]
Post subject:  Re: [Fix] Fixing input

Thom

Author:  wanai [ Fri Jan 07, 2022 6:13 am ]
Post subject:  Re: [Fix] Fixing input

Mohi

Author:  wanai [ Fri Jan 07, 2022 6:14 am ]
Post subject:  Re: [Fix] Fixing input

Shop

Author:  wanai [ Fri Jan 07, 2022 6:15 am ]
Post subject:  Re: [Fix] Fixing input

Gera

Author:  wanai [ Fri Jan 07, 2022 6:16 am ]
Post subject:  Re: [Fix] Fixing input

Robe

Author:  wanai [ Fri Jan 07, 2022 6:17 am ]
Post subject:  Re: [Fix] Fixing input

Vide

Author:  wanai [ Fri Jan 07, 2022 6:18 am ]
Post subject:  Re: [Fix] Fixing input

EyeT

Author:  wanai [ Fri Jan 07, 2022 6:20 am ]
Post subject:  Re: [Fix] Fixing input

Fisk

Page 1 of 55 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/