Small Basic Forum
GraphicsWindow.LastKey - Printable Version

+- Small Basic Forum (https://litdev.uk/mybb)
+-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1)
+--- Forum: Standard Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=2)
+--- Thread: GraphicsWindow.LastKey (/showthread.php?tid=210)

Pages: 1 2


RE: GraphicsWindow.LastKey - AbsoluteBeginner - 01-16-2025

(translated by Google translator)

Thank you very much for this discussion.  Shy
This discussion is very helpful.
I didn't even know that such unexpected problems existed.

It would be great if other users would also share their problems on our forum.

I wish everyone good luck.  Wink


RE: GraphicsWindow.LastKey - litdev - 01-16-2025

Following from this discussion I added some new methods to LitDev extension, version 1.2.29.14 (get with Extension Manager or website).

LDFocus.ResetFocus()
LDTextWindow.LastKeyReset()
LDGraphicsWindow.LastKeyReset()


RE: GraphicsWindow.LastKey - jrmrhrb00 - 01-16-2025

LitDev,

Thanks for doing this! Here's proof that it works. Run the snippet and hit the return key. LDGraphicsWindow.LastKeyReset does it's function.

GraphicsWindow.Show()
While key <> "Return"
  Key=GraphicsWindow.LastKey
EndWhile
Program.Delay(10)
TW.WriteLine(key)
LDGraphicsWindow.LastKeyReset()
TW.WriteLine(GraphicsWindow.Lastkey)

JR


RE: GraphicsWindow.LastKey - z-s - 01-17-2025

Reflection is really awesome I was trying using ZSReflection to do this get assembly key then get type key of GW and the set the "_lastkey" field to none but got some errors I will try to diagnose why error are coming.


RE: GraphicsWindow.LastKey - litdev - 01-17-2025

Hi ZS,

Syntax is a bit nasty, but its one line of code so if you want I can share or help explain.


RE: GraphicsWindow.LastKey - z-s - 01-18-2025

i made code but it didn't work does you tried.


RE: GraphicsWindow.LastKey - litdev - 01-18-2025

(01-18-2025, 10:29 AM)z-s Wrote: i made code but it didn't work does you tried.

typeof(GraphicsWindow).GetField("_lastKey", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).SetValue(null, System.Windows.Input.Key.None);