MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000213Soldat Dedicated ServerScripting Corepublic2012-05-19 02:022012-06-23 21:00
ReporterJotEmI 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
Platformi386OSDebian GNU/LinuxOS Version6.0
Product Version2.7.3 
Target VersionFixed in Version 
Summary0000213: GetKeyPress() not working properly
DescriptionI've already mentioned it on the forums.soldat.pl. GetKeyPress() seems to always return false (at least for the "throw" key) when called inside OnWeaponChange event.

Quote from forums.soldat.pl:

[code]
const
Msg=$FFFF9922;

procedure AppOnIdle(Ticks: integer);
begin
    if(GetKeyPress(1,'Throw')=true)then
    begin
        WriteConsole(0,'Throw key pressed (AppOnIdle)!',Msg);
    end;
end;

procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: Byte);
begin
    WriteConsole(0,'In OnWeaponChange!',Msg);
    if(GetKeyPress(ID,'Throw')=true)then
    begin
        WriteConsole(0,'Throw key pressed (OnWeaponChange)!',Msg);
    end;
end;
[/code]

The one in AppOnIdle does seem to work but GetKeyPress() in OnWeaponChange always returns false.
I've added a little debug info to check whether pressing the throw key calls OnWeaponChange and it does.

One more strange thing. If you have no weapon (thus OnWeaponChange won't be called) and press and hold the throw key the message in AppOnIdle will spam every second, which is correct. But if you got a weapon, press and hold the throw key (calling OnWeaponChange) you will only get one or zero messages from AppOnIdle. Like somehow after OnWeaponChange() result of GetKeyPress() is set to be always false.
TagsNo tags attached.
John
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2012-05-19 02:02 JotEmI New Issue
2012-06-23 21:00 Falcon Status new => acknowledged


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker