File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
osu.Framework/Platform/SDL3 Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,9 @@ private void handleTextEditingEvent(SDL_TextEditingEvent evtEdit)
508508
509509 private void handleKeyboardEvent ( SDL_KeyboardEvent evtKey )
510510 {
511+ // GlobalEventTimestamps.LastTimestamp = (long)evtKey.timestamp;
512+ GlobalEventTimestamps . LastTimestamp = GlobalEventTimestamps . GetTimestamp ( ) ;
513+
511514 Key key = evtKey . ToKey ( ) ;
512515
513516 if ( key == Key . Unknown )
@@ -760,4 +763,15 @@ private void updateConfineMode()
760763
761764 #endregion
762765 }
766+
767+ public static class GlobalEventTimestamps
768+ {
769+ public static long LastTimestamp ;
770+
771+ public static long GetTimestamp ( ) => Stopwatch . GetTimestamp ( ) ;
772+ public static double GetDelta ( long t1 , long t2 ) => ( double ) ( t2 - t1 ) / Stopwatch . Frequency * 1000 ;
773+
774+ public static ulong GetTimestamp_SDL ( ) => SDL_GetTicksNS ( ) ;
775+ public static double GetDelta_SDL ( ulong t1 , ulong t2 ) => ( t2 - t1 ) / 1e6 ;
776+ }
763777}
You can’t perform that action at this time.
0 commit comments