-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sourcecode-lastempystep-fix'
- Loading branch information
Showing
31 changed files
with
4,021 additions
and
1,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ | |
build/ | ||
.gradletasknamecache | ||
|
||
### Kotlin ### | ||
.kotlin | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+84.6 KB
(140%)
Compose-Ur-Pres/cup-gradle-plugin/src/main/resources/icons/cup.icns
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4,270 changes: 3,449 additions & 821 deletions
4,270
Compose-Ur-Pres/cup-source-code/src/jvmMain/resources/highlight.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Compose-Ur-Pres/cup/src/jvmMain/kotlin/net/kodein/cup/CupKeyEvent.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.kodein.cup | ||
|
||
import androidx.compose.ui.input.key.* | ||
|
||
|
||
public actual val CupKeyEvent.key: Key get() = KeyEvent(nativeKeyEvent).key | ||
public actual val CupKeyEvent.isCtrlPressed: Boolean get() = KeyEvent(nativeKeyEvent).isCtrlPressed | ||
public actual val CupKeyEvent.isAltPressed: Boolean get() = KeyEvent(nativeKeyEvent).isAltPressed | ||
public actual val CupKeyEvent.isShiftPressed: Boolean get() = KeyEvent(nativeKeyEvent).isShiftPressed | ||
public actual val CupKeyEvent.isMetaPressed: Boolean get() = KeyEvent(nativeKeyEvent).isMetaPressed | ||
public actual val CupKeyEvent.type: KeyEventType get() = KeyEvent(nativeKeyEvent).type | ||
|
||
@PluginCupAPI | ||
public fun ((CupKeyEvent) -> Boolean).asComposeKeyHandler(): (KeyEvent) -> Boolean = { | ||
invoke(CupKeyEvent(it.nativeKeyEvent)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Compose-Ur-Pres/cup/src/wasmJsMain/kotlin/net/kodein/cup/CupKeyEvent.web.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package net.kodein.cup | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.DisposableEffect | ||
import androidx.compose.ui.InternalComposeUiApi | ||
import androidx.compose.ui.input.key.* | ||
import kotlinx.browser.window | ||
import org.w3c.dom.events.Event | ||
import org.w3c.dom.events.KeyboardEvent | ||
|
||
public actual val CupKeyEvent.key: Key get() = Key((nativeKeyEvent as KeyboardEvent).keyCode.toLong()) | ||
public actual val CupKeyEvent.isCtrlPressed: Boolean get() = (nativeKeyEvent as KeyboardEvent).ctrlKey | ||
public actual val CupKeyEvent.isAltPressed: Boolean get() = (nativeKeyEvent as KeyboardEvent).altKey | ||
public actual val CupKeyEvent.isShiftPressed: Boolean get() = (nativeKeyEvent as KeyboardEvent).shiftKey | ||
public actual val CupKeyEvent.isMetaPressed: Boolean get() = (nativeKeyEvent as KeyboardEvent).metaKey | ||
public actual val CupKeyEvent.type: KeyEventType get() = when ((nativeKeyEvent as KeyboardEvent).type) { | ||
"keyup" -> KeyEventType.KeyUp | ||
"keydown" -> KeyEventType.KeyDown | ||
else -> KeyEventType.Unknown | ||
} | ||
|
||
|
||
@PluginCupAPI | ||
@Composable | ||
public fun WindowKeyHandlerEffect(handler: (CupKeyEvent) -> Boolean) { | ||
DisposableEffect(null) { | ||
val listener: (Event) -> Unit = { event -> | ||
event as KeyboardEvent | ||
val handled = handler.invoke(CupKeyEvent(event)) | ||
if (handled) event.stopPropagation() | ||
} | ||
window.addEventListener("keyup", listener) | ||
window.addEventListener("keydown", listener) | ||
|
||
onDispose { | ||
window.removeEventListener("keyup", listener) | ||
window.removeEventListener("keydown", listener) | ||
} | ||
} | ||
} |
52 changes: 0 additions & 52 deletions
52
Compose-Ur-Pres/cup/src/wasmJsMain/kotlin/net/kodein/cup/convertors.web.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.