mirror of
https://github.com/glfw/glfw.git
synced 2025-12-21 14:42:06 +00:00
Compare commits
3 Commits
6f9258a771
...
0cce701a0a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cce701a0a | ||
|
|
0d2d85d19c | ||
|
|
662454b552 |
@ -940,9 +940,10 @@ with @ref glfwGetTimerValue.
|
||||
uint64_t value = glfwGetTimerValue();
|
||||
```
|
||||
|
||||
This value is in 1 / frequency seconds. The frequency of the raw
|
||||
timer varies depending on the operating system and hardware. You can query the
|
||||
frequency, in Hz, with @ref glfwGetTimerFrequency.
|
||||
This function returns the current value of the raw timer. To get the current time in
|
||||
1 / frequency seconds, use `glfwGetTimerValue() / glfwGetTimerFrequency()`.
|
||||
The frequency of the rawtimer varies depending on the operating system and hardware.
|
||||
You can query the frequency, in Hz, with @ref glfwGetTimerFrequency.
|
||||
|
||||
```c
|
||||
uint64_t frequency = glfwGetTimerFrequency();
|
||||
|
||||
@ -6037,9 +6037,12 @@ GLFWAPI void glfwSetTime(double time);
|
||||
|
||||
/*! @brief Returns the current value of the raw timer.
|
||||
*
|
||||
* This function returns the current value of the raw timer, measured in
|
||||
* 1 / frequency seconds. To get the frequency, call @ref
|
||||
* glfwGetTimerFrequency.
|
||||
* This function returns the current value of the raw timer. To get the
|
||||
* current time measured in 1 / frequency seconds, use
|
||||
* @ref glfwGetTimerValue / @ref glfwGetTimerFrequency.
|
||||
* To get the frequency, call @ref glfwGetTimerFrequency.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return The value of the timer, or zero if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
|
||||
@ -1778,24 +1778,6 @@ static void keyboardHandleLeave(void* userData,
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
// Handle any key repeats up to this point. We don't poll as this should be infrequent.
|
||||
uint64_t repeats;
|
||||
if (read(_glfw.wl.keyRepeatTimerfd, &repeats, sizeof(repeats)) == 8)
|
||||
{
|
||||
if(_glfw.wl.keyboardFocus)
|
||||
{
|
||||
for (uint64_t i = 0; i < repeats; i++)
|
||||
{
|
||||
_glfwInputKey(_glfw.wl.keyboardFocus,
|
||||
translateKey(_glfw.wl.keyRepeatScancode),
|
||||
_glfw.wl.keyRepeatScancode,
|
||||
GLFW_PRESS,
|
||||
_glfw.wl.xkb.modifiers);
|
||||
inputText(_glfw.wl.keyboardFocus, _glfw.wl.keyRepeatScancode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct itimerspec timer = {0};
|
||||
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user