Files
kryon/examples/17_keyboard_platform.kry
T
2026-08-09 19:52:01 -03:00

28 lines
732 B
Plaintext

#import "kryon.h"
app "Kryon Keyboard Platform" {
size 800 600
fps 60
font examples
theme THEME_SKY light
}
state {
copied: int = 0
message: [128] char = "Press Ctrl/Cmd+C to copy text."
}
screen KeyboardPlatformExample(viewport: Rectangle) {
Background(GetThemeBackground())
Text("Keyboard and clipboard", 40, 40, UI_TEXT_24, GetThemeText())
Text(message, 40, 90, UI_TEXT_16, GetThemeText())
if UIAcceleratorPressed((UIAccelerator){KEY_C,1,0,0,1}) {
SetUIClipboardTextValue("Copied from Kryon")
snprintf(message,sizeof(message),"Copied to clipboard")
copied = 1
}
if copied {
Text("Clipboard updated.", 40, 130, UI_TEXT_16, GetThemeLink())
}
}