@ -63,8 +63,10 @@ pub struct RawInput {
/// drag-and-drop support using `eframe::NativeOptions`.
pub dropped_files : Vec < DroppedFile > ,
/// The window has the keyboard focus (i.e. is receiving key presses).
pub has_focus : bool ,
/// The native window has the keyboard focus (i.e. is receiving key presses).
///
/// False when the user alt-tab away from the application, for instance.
pub focused : bool ,
}
impl Default for RawInput {
@ -79,7 +81,7 @@ impl Default for RawInput {
events : vec ! [ ] ,
hovered_files : Default ::default ( ) ,
dropped_files : Default ::default ( ) ,
has_ focus : true , // integrations opt into global focus tracking
focused : true , // integrations opt into global focus tracking
}
}
}
@ -100,7 +102,7 @@ impl RawInput {
events : std ::mem ::take ( & mut self . events ) ,
hovered_files : self . hovered_files . clone ( ) ,
dropped_files : std ::mem ::take ( & mut self . dropped_files ) ,
has_ focus : self . has_ focus,
focused : self . focused ,
}
}
@ -116,7 +118,7 @@ impl RawInput {
mut events ,
mut hovered_files ,
mut dropped_files ,
has_ focus,
focused ,
} = newer ;
self . screen_rect = screen_rect . or ( self . screen_rect ) ;
@ -128,7 +130,7 @@ impl RawInput {
self . events . append ( & mut events ) ;
self . hovered_files . append ( & mut hovered_files ) ;
self . dropped_files . append ( & mut dropped_files ) ;
self . has_ focus = has_ focus;
self . focused = focused ;
}
}
@ -294,6 +296,9 @@ pub enum Event {
modifiers : Modifiers ,
} ,
/// The native window gained or lost focused (e.g. the user clicked alt-tab).
WindowFocused ( bool ) ,
/// An assistive technology (e.g. screen reader) requested an action.
#[ cfg(feature = " accesskit " ) ]
AccessKitActionRequest ( accesskit ::ActionRequest ) ,
@ -847,7 +852,7 @@ impl RawInput {
events ,
hovered_files ,
dropped_files ,
has_ focus,
focused ,
} = self ;
ui . label ( format ! ( "screen_rect: {:?} points" , screen_rect ) ) ;
@ -865,7 +870,7 @@ impl RawInput {
ui . label ( format ! ( "modifiers: {:#?}" , modifiers ) ) ;
ui . label ( format ! ( "hovered_files: {}" , hovered_files . len ( ) ) ) ;
ui . label ( format ! ( "dropped_files: {}" , dropped_files . len ( ) ) ) ;
ui . label ( format ! ( "has_ focus: {}" , has_ focus) ) ;
ui . label ( format ! ( "focused : {}" , focused ) ) ;
ui . scope ( | ui | {
ui . set_min_height ( 150.0 ) ;
ui . label ( format ! ( "events: {:#?}" , events ) )