Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
return KEYBOARD_LAYOUT_QWERTY;
}
}
case SYSPROP_BATTERY_PERCENTAGE:
{
SYSTEM_POWER_STATUS status{};
if (GetSystemPowerStatus(&status)) {
return status.BatteryLifePercent < 255 ? status.BatteryLifePercent : 100;
} else {
return 100;
}
}
default:
return -1;
}
Expand Down Expand Up @@ -395,6 +404,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
return IsDebuggerPresent();
case SYSPROP_OK_BUTTON_LEFT:
return true;
case SYSPROP_CAN_READ_BATTERY_PERCENTAGE:
return true;
default:
return false;
}
Expand Down
Loading