All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.com.lehaine.littlekt.JvmClipboard.kt Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package com.lehaine.littlekt

import com.lehaine.littlekt.util.Clipboard
import org.lwjgl.glfw.GLFW

/**
 * @author Colton Daily
 * @date 2/21/2022
 */
class JvmClipboard(private val window: Long) : Clipboard {
    override val hasContents: Boolean
        get() {
            val value = contents
            return value != null && value.isNotEmpty()
        }
    override var contents: String?
        get() = GLFW.glfwGetClipboardString(window)
        set(value) {
            GLFW.glfwSetClipboardString(window, value ?: "")
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy