text: 
  #include "klpch.h"
  
  
  
  #include "WindowsInput.h"
  
  #include <GLFW/glfw3.h>
  #include "Kali/Application.h"
  
  namespace Kali
  {
  
  	Input* Input::s_instance = new WindowsInput();
  
  	bool WindowsInput::IsKeyPressedImpl(int keycode)
  	{
  		auto* window = static_cast<GLFWwindow*>(Application::Get().GetWindow().GetNativeWindow());
  		const auto state = glfwGetKey(window, keycode);
  		return state == GLFW_PRESS || state == GLFW_REPEAT;
  	}
  
  	bool WindowsInput::IsMouseButtonPressedImpl(int button)
  	{
  		auto* window = static_cast<GLFWwindow*>(Application::Get().GetWindow().GetNativeWindow());
  		const auto state = glfwGetMouseButton(window, button);
  		return state == GLFW_PRESS;
  	}
  
  	std::pair<float, float> WindowsInput::GetMousePositionImpl()
  	{
  		auto* window = static_cast<GLFWwindow*>(Application::Get().GetWindow().GetNativeWindow());
  		double x_pos, y_pos;
  		glfwGetCursorPos(window, &x_pos, &y_pos);
  		return {static_cast<float>(x_pos), static_cast<float>(y_pos)};
  	}
  
  	float WindowsInput::GetMouseXImpl()
  	{
  		auto[x, y] = GetMousePositionImpl();
  		return x;
  	}
  
  	float WindowsInput::GetMouseYImpl()
  	{
  		auto [x, y] = GetMousePositionImpl();
  		return y;
  	}
  }
  