Jump to content

Input problem, sendkey etc not working


Recommended Posts

My problem is relatively simple, I think. Normally, au3irrlicht scene is the active window, however, in this case, the active window is the gui, and the au3irrlicht is a separate process entirely. Because it's embedded, I don't want it to be active. The mouse movement works fine, but i need to redirect the arrow keys, somehow.

How would I send arrow key up/down to the second process?

I could use animators and work out a custom camera, which wouldn't be too hard, but I'd rather use the one that's already there.

The Secondary process which is handling the irrlicht side of things is identified by $CoProc1Process

You'll need CoProc.zip and Au3Irrlicht.zip in order to run this.

I'm fairly sure this is just a controlsend issue, but there aren't any controls I'm sending to that are apparent to me, right off.

CODE
#NoTrayIcon

#include <GUIConstants.au3>

#include "coproc.au3"

#include "IrrlichtPluginUtils.au3"

#region GUI Process

$CoProc1Process = _CoProc ("CoProc1")

AutoItSetOption( "TrayIconHide", 1 )

Opt( "WinTitleMatchMode", 3 )

$gui = GUICreate( "Autoit Irrlicht", 450, 260 )

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg( )

If $msg = $GUI_EVENT_CLOSE then

ExitLoop

EndIf

WEnd

ProcessClose($CoProc1Process)

Exit

Func CoProc1()

#include <GUIConstants.au3>

#include "IrrlichtPluginUtils.au3"

$gui2 = WinGetHandle("Autoit Irrlicht")

CreateDeviceOnWindow( $gui2, $EDT_OPENGL, 10, 10, 320, 240, 32, 0, 0 );

;Add Light

$Light = AddLightSceneNode( 0, 2000, 2000, 0, 1, 1, 1, 10000 )

;Add Camera

$Camera = AddCameraSceneNodeFPS( 0, 100, 200, 0, 0.8 )

SetPosition( $Camera, 700, 550, 0 ) ;setting position

SetTarget( $Camera, 1000, 25, 0 ) ;setting target

;Add Terrain

$HeighMap = CreateImageFromFile( @ScriptDir & "\data\terrain-heightmap.bmp" )

$TextureMap = CreateImageFromFile( @ScriptDir & "\data\terrain-texture.jpg" )

$MapMesh = AddTerrainMesh( "Heigh1", $TextureMap, $HeighMap, 15.0, 15.0, 500, 64, 64 )

$Node = AddOctTreeSceneNode( $MapMesh )

SetPosition( $Node, -500, 0, -500 )

;Playing with automatic collision detection

$MapSelector = CreateOctTreeTriangleSelector( $MapMesh, $Node )

SetTriangleSelector( $Node, $MapSelector )

$MapCameraAnimator = CreateCollisionResponseAnimator( $MapSelector, $Camera, 20, 50, 20, 0, -1, 0, 0, -24, 0 ) ;character can collide it

AddAnimator( $Camera, $MapCameraAnimator )

DropAnimator( $MapCameraAnimator )

While IrrRun( )

;BeginScene( bool backBuffer, bool zBuffer, int Alpha, int Red, int Green, int Blue )

BeginScene( true, true, 255, 200, 180, 150 )

;gets collision from Vader

SceneDraw( )

GuiDraw( )

EndScene( )

Wend

EndFunc

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...