<commit_before>/*
 * This file is part of `et engine`
 * Copyright 2009-2013 by <NAME>
 * Please, do not modify content without approval.
 *
 */

#include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>

#include <et/core/tools.h>
#include <et/input/input.h>

using namespace et;

bool Input::canGetCurrentPointerInfo()
	{ return true; }

PointerInputInfo Input::currentPointer()
{
	NSWindow* keyWindow = [[NSApplication sharedApplication] keyWindow];
	NSRect frame = [keyWindow contentRectForFrameRect:[keyWindow frame]];
	NSPoint location = [keyWindow convertScreenToBase:[NSEvent mouseLocation]];
	
	PointerInputInfo result;
	
	result.timestamp = queryContiniousTimeInSeconds();
	result.pos = vec2(static_cast<float>(location.x), static_cast<float>(frame.size.height - location.y));
	result.normalizedPos = result.pos /
		vec2(static_cast<float>(frame.size.width), static_cast<float>(frame.size.height));
	
	return result;
}

void Input::activateSoftwareKeyboard()
{
}

void Input::deactivateSoftwareKeyboard()
{
}<commit_msg>OS X deprecated method replaced<commit_after>/*
 * This file is part of `et engine`
 * Copyright 2009-2013 by <NAME>
 * Please, do not modify content without approval.
 *
 */

#include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>

#include <et/core/tools.h>
#include <et/input/input.h>

using namespace et;

bool Input::canGetCurrentPointerInfo()
	{ return true; }

PointerInputInfo Input::currentPointer()
{
	NSPoint location = [NSEvent mouseLocation];
	
	NSWindow* keyWindow = [[NSApplication sharedApplication] keyWindow];
	NSRect frame = [keyWindow contentRectForFrameRect:[keyWindow frame]];
//	NSPoint location = [keyWindow convertScreenToBase:[NSEvent mouseLocation]];
	location = [keyWindow convertRectFromScreen:NSMakeRect(location.x, location.y, 1.0f, 1.0f)].origin;
	
	PointerInputInfo result;
	
	result.timestamp = queryContiniousTimeInSeconds();
	result.pos = vec2(static_cast<float>(location.x), static_cast<float>(frame.size.height - location.y));
	result.normalizedPos = result.pos /
		vec2(static_cast<float>(frame.size.width), static_cast<float>(frame.size.height));
	
	return result;
}

void Input::activateSoftwareKeyboard()
{
}

void Input::deactivateSoftwareKeyboard()
{
}
{'fraction_non_alphanumeric': 0.1282394995531725, 'fraction_numerical': 0.010723860589812333, 'mean_word_length': 5.996875, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1659100', 'n_tokens_mistral': 738, 'n_tokens_neox': 694, 'n_words': 152}