28 lines
732 B
Plaintext
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())
|
|
}
|
|
}
|