<commit_before>package openfl._legacy.display; #if (openfl_legacy && lime_hybrid)


import lime.app.IModule;
import lime.graphics.RenderContext;
import lime.system.System;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
import lime.ui.KeyCode;
import lime.ui.KeyModifier;
import openfl._legacy.events.Event;
import openfl._legacy.Lib;
import openfl.ui.Keyboard;

@:access(openfl._legacy.Lib)
@:access(openfl.ui.Keyboard)


class HybridStage extends ManagedStage implements IModule {
	
	
	public function new (width:Int, height:Int, color:Null<Int> = null) {
		
		Lib.__stage = this;
		Lib.initWidth = width;
		Lib.initHeight = height;
		
		var flags = 0x00000080; // allow shaders
		
		super (width, height, flags);
		
		frameRate = 60;
		
		if (color != null) {
			
			this.color = color;
			
		}
		
		onWindowResize (width, height);
		
	}
	
	
	public function init (context:RenderContext):Void {
		
		
		
	}
	
	
	public function onGamepadAxisMove (gamepad:Gamepad, axis:GamepadAxis, value:Float):Void {
		
		pumpEvent ( { type: ManagedStage.etJoyAxisMove, id: gamepad.id, code: axis, value: value } );
		
	}
	
	
	public function onGamepadButtonDown (gamepad:Gamepad, button:GamepadButton):Void {
		
		pumpEvent ( { type: ManagedStage.etJoyButtonDown, id: gamepad.id, code: button } );
		
	}
	
	
	public function onGamepadButtonUp (gamepad:Gamepad, button:GamepadButton):Void {
		
		pumpEvent ( { type: ManagedStage.etJoyButtonUp, id: gamepad.id, code: button } );
		
	}
	
	
	public function onGamepadConnect (gamepad:Gamepad):Void {
		
		
		
	}
	
	
	public function onGamepadDisconnect (gamepad:Gamepad):Void {
		
		
		
	}
	
	
	public function onKeyDown (keyCode:KeyCode, modifier:KeyModifier):Void {
		
		var flags = 0;
		if (modifier.shiftKey) flags |= ManagedStage.efShiftDown;
		if (modifier.ctrlKey) flags |= ManagedStage.efCtrlDown;
		if (modifier.altKey) flags |= ManagedStage.efAltDown;
		if (modifier.metaKey) flags |= ManagedStage.efCommandDown;
		
		var value = Keyboard.__convertKeyCode (keyCode);
		var code = Keyboard.__getCharCode (value, modifier.shiftKey);
		
		pumpEvent ( { type: ManagedStage.etKeyDown, value: value, code: code, flags: flags } );
		
	}
	
	
	public function onKeyUp (keyCode:KeyCode, modifier:KeyModifier):Void {
		
		var flags = 0;
		if (modifier.shiftKey) flags |= ManagedStage.efShiftDown;
		if (modifier.ctrlKey) flags |= ManagedStage.efCtrlDown;
		if (modifier.altKey) flags |= ManagedStage.efAltDown;
		if (modifier.metaKey) flags |= ManagedStage.efCommandDown;
		
		var value = Keyboard.__convertKeyCode (keyCode);
		var code = Keyboard.__getCharCode (value, modifier.shiftKey);
		
		pumpEvent ( { type: ManagedStage.etKeyUp, value: value, code: code, flags: flags } );
		
	}
	
	
	public function onModuleExit ():Void {
		
		
		<commit_msg>Hybrid fix<commit_after>package openfl._legacy.display; #if (openfl_legacy && lime_hybrid)


import lime.app.IModule;
import lime.graphics.RenderContext;
import lime.system.System;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
import lime.ui.KeyCode;
import lime.ui.KeyModifier;
import openfl._legacy.events.Event;
import openfl._legacy.Lib;
import openfl.ui.Keyboard;

@:access(openfl._legacy.Lib)
@:access(openfl.ui.Keyboard)


class HybridStage extends ManagedStage implements IModule {
	
	
	public function new (width:Int, height:Int, color:Null<Int> = null) {
		
		Lib.__stage = this;
		Lib.initWidth = width;
		Lib.initHeight = height;
		
		var flags = 0x00000080; // allow shaders
		
		super (width, height, flags);
		
		frameRate = 60;
		
		if (color != null) {
			
			this.color = color;
			
		}
		
		onWindowResize (width, height);
		
	}
	
	
	public function init (context:RenderContext):Void {
		
		
		
	}
	
	
	public function onGamepadAxisMove (gamepad:Gamepad, axis:GamepadAxis, value:Float):Void {
		
		pumpEvent ( { type: ManagedStage.etJoyAxisMove, id: gamepad.id, code: axis, value: value } );
		
	}
	
	
	public function onGamepadButtonDown (gamepad:Gamepad, button:GamepadButton):Void {
		
		pumpEvent ( { type: ManagedStage.etJoyButtonDown, id: gamepad.id, code: button } );
		
	}
	
	
	public function onGamepadButtonUp (gamepad:Gamepad, button:GamepadButton):Void {
		
		pumpEvent ( { type: ManagedStage.etJoyButtonUp, id: gamepad.id, code: button } );
		
	}
	
	
	public function onGamepadConnect (gamepad:Gamepad):Void {
		
		
		
	}
	
	
	public function onGamepadDisconnect (gamepad:Gamepad):Void {
		
		
		
	}
	
	
	public function onKeyDown (keyCode:KeyCode, modifier:KeyModifier):Void {
		
		var flags = 0;
		if (modifier.shiftKey) flags |= ManagedStage.efShiftDown;
		if (modifier.ctrlKey) flags |= ManagedStage.efCtrlDown;
		if (modifier.altKey) flags |= ManagedStage.efAltDown;
		if (modifier.metaKey) flags |= ManagedStage.efCommandDown;
		
		var value = Keyboard.__convertKeyCode (keyCode);
		var code = Keyboard.__getCharCode (value, modifier.shiftKey);
		
		pumpEvent ( { type: ManagedStage.etKeyDown, value: value, code: code, flags: flags } );
		
	}
	
	
	public function onKeyUp (keyCode:KeyCode, modifier:KeyModifier):Void {
		
		var flags = 0;
		if (modifier.shiftKey) flags |= ManagedStage.efShiftDown;
		if (modifier.ctrlKey) flags |= ManagedStage.efCtrlDown;
		if (modifier.altKey) flags |= ManagedStage.efAltDown;
		if (modifier.metaKey) flags |= ManagedStage.efCommandDown;
		
		var value = Keyboard.__convertKeyCode (keyCode);
		var code = Keyboard.__getCharCode (value, modifier.shiftKey);
		
		pumpEvent ( { type: ManagedStage.etKeyUp, value: value, code: code, flags: flags } );
		
	}
	
	
	public function onModuleExit (code:Int):Void {
		
		
		
{'fraction_non_alphanumeric': 0.11181995392521708, 'fraction_numerical': 0.004607478291688818, 'mean_word_length': 3.9770723104056436, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1542987', 'n_tokens_mistral': 2192, 'n_tokens_neox': 1867, 'n_words': 413}