iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >Compose for Desktop鼠标事件源码分析
  • 229
分享到

Compose for Desktop鼠标事件源码分析

2023-07-05 13:07:52 229人浏览 泡泡鱼
摘要

这篇文章主要讲解了“Compose for Desktop鼠标事件源码分析”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Compose for Des

这篇文章主要讲解了“Compose for Desktop鼠标事件源码分析”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Compose for Desktop鼠标事件源码分析”吧!

鼠标事件监听器

点击监听器

点击监听器在安卓Compose 和Compose for Desktop中都是可用的, 所以像这样的代码在两个平台上都可以使用:

import Androidx.compose.foundation.ExperimentalFoundationapiimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.combinedClickableimport androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.fillMaxHeightimport androidx.compose.foundation.layout.fillMaxWidthimport androidx.compose.material.Textimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.unit.spimport androidx.compose.ui.window.singleWindowApplicationfun main() = singleWindowApplication {    var count by remember { mutableStateOf(0) }    Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxWidth()) {        var text by remember { mutableStateOf("Click magenta box!") }        Column {            @OptIn(ExperimentalFoundationApi::class)            Box(                modifier = Modifier                    .background(Color.Magenta)                    .fillMaxWidth(0.7f)                    .fillMaxHeight(0.2f)                    .combinedClickable(                        onClick = {                            text = "Click! ${count++}"                        },                        onDoubleClick = {                            text = "Double click! ${count++}"                        },                        onLonGClick = {                            text = "Long click! ${count++}"                        }                    )            )            Text(text = text, fontSize = 40.sp)        }    }}

combinedClickable只支持主按钮(鼠标左键)和触摸事件. 如果需要以不同方式处理其他按钮, 请看下面的Modifier.onClick(注意: Modifier.onClick目前只适用于Desktop-JVM平台).

鼠标移动监听器

让我们创建一个窗口, 并在其上安装一个指针移动监听器, 根据鼠标指针的位置来改变背景颜色:

import androidx.compose.foundation.backgroundimport androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.foundation.layout.wrapContentSizeimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.input.pointer.PointerEventTypeimport androidx.compose.ui.input.pointer.onPointerEventimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalComposeUiApi::class)fun main() = singleWindowApplication {    var color by remember { mutableStateOf(Color(0, 0, 0)) }    Box(        modifier = Modifier            .wrapContentSize(Alignment.Center)            .fillMaxSize()            .background(color = color)            .onPointerEvent(PointerEventType.Move) {                val position = it.changes.first().position                color = Color(position.x.toInt() % 256, position.y.toInt() % 256, 0)            }    )}

注意, onPointerEvent是实验性的, 将来可能会被改变. 对于更多稳定的API请看Modifier.pointerInput.

鼠标进入监听器

Compose for Desktop 也支持指针的进入和退出处理, 像这样:

import androidx.compose.foundation.backgroundimport androidx.compose.foundation.layout.Arrangementimport androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.fillMaxWidthimport androidx.compose.material.Textimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.input.pointer.PointerEventTypeimport androidx.compose.ui.input.pointer.onPointerEventimport androidx.compose.ui.text.font.FontStyleimport androidx.compose.ui.unit.dpimport androidx.compose.ui.unit.spimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalComposeUiApi::class)fun main() = singleWindowApplication {    Column(        Modifier.background(Color.White),        verticalArrangement = Arrangement.spacedBy(10.dp)    ) {        repeat(10) { index ->            var active by remember { mutableStateOf(false) }            Text(                modifier = Modifier                    .fillMaxWidth()                    .background(color = if (active) Color.Green else Color.White)                    .onPointerEvent(PointerEventType.Enter) { active = true }                    .onPointerEvent(PointerEventType.Exit) { active = false },                fontSize = 30.sp,                fontStyle = if (active) FontStyle.Italic else FontStyle.NORMal,                text = "Item $index"            )        }    }}

注意, onPointerEvent是实验性的, 将来可能会被改变. 对于更多稳定的API请看Modifier.pointerInput.

鼠标滚动监听器

import androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.material.Textimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.input.pointer.PointerEventTypeimport androidx.compose.ui.input.pointer.onPointerEventimport androidx.compose.ui.unit.spimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalComposeUiApi::class)fun main() = singleWindowApplication {    var number by remember { mutableStateOf(0f) }    Box(        Modifier            .fillMaxSize()            .onPointerEvent(PointerEventType.Scroll) {                number += it.changes.first().scrollDelta.y            },        contentAlignment = Alignment.Center    ) {        Text("Scroll to change the number: $number", fontSize = 30.sp)    }}

注意, onPointerEvent是实验性的, 将来可能会被改变. 对于更多稳定的API请看Modifier.pointerInput.

与Swing的交互操作

Compose for Desktop内部使用Swing, 并允许访问原始AWT事件:

import androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.material.Textimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.awt.awtEventOrNullimport androidx.compose.ui.input.pointer.PointerEventTypeimport androidx.compose.ui.input.pointer.onPointerEventimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalComposeUiApi::class)fun main() = singleWindowApplication {    var text by remember { mutableStateOf("") }    Box(        Modifier            .fillMaxSize()            .onPointerEvent(PointerEventType.Press) {                text = it.awtEventOrNull?.locationOnScreen?.toString().orEmpty()            },        contentAlignment = Alignment.Center    ) {        Text(text)    }}

注意, onPointerEvent是实验性的, 将来可能会被改变. 对于更多稳定的API请看Modifier.pointerInput.

在commonMain中通过Modifier.pointerInput监听原生事件

在上面的片段中, 我们使用了Modifier.onPointerEvent, 它是一个辅助函数, 用于订阅某种类型的指针事件. 它是Modifier.pointerInput的一个简短变体. 目前, 它是实验性的, 并且只在桌面上使用(你不能在普通主代码中使用它). 如果你需要在commonMain中订阅事件或者你需要稳定的API, 你可以使用Modifier.pointerInput:

import androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.material.Textimport androidx.compose.runtime.mutableStateListOfimport androidx.compose.runtime.rememberimport androidx.compose.ui.Modifierimport androidx.compose.ui.input.pointer.PointerEventTypeimport androidx.compose.ui.input.pointer.pointerInputimport androidx.compose.ui.window.singleWindowApplicationfun main() = singleWindowApplication {    val list = remember { mutableStateListOf<String>() }    Column(        Modifier            .fillMaxSize()            .pointerInput(Unit) {                awaitPointerEventScope {                    while (true) {                        val event = awaitPointerEvent()                        val position = event.changes.first().position                        // on every relayout Compose will send synthetic Move event,                        // so we skip it to avoid event spam                        if (event.type != PointerEventType.Move) {                            list.add(0, "${event.type} $position")                        }                    }                }            },    ) {        for (item in list.take(20)) {            Text(item)        }    }}

新的实验性onClick处理(仅适用于Desktop-JVM平台)

Modifier.onClick为点击, 双击, 长按提供独立的回调. 它只处理源于指针事件的点击, 并且可访问性点击事件不被处理.

每个onClick可以被配置为针对特定的指针事件(使用matcher: PointerMatcher和keyboardModifiers: PointerKeyboardModifiers.() -> Boolean). matcher可以被指定来选择什么鼠标按钮应该触发点击. keyboardModifiers允许过滤有指定keyboardModifiers按下的指针事件.

多个onClick修改器可以被连, 以处理不同条件的点击(匹配器和键盘修改器). 与clickable不同, onClick没有默认的Modifier.indication, Modifier.semantics, 当Enter按下时, 它不会触发一个点击事件. 如果有必要, 这些修改器需要单独添加. 最通用的(条件最少的)onClick处理程序应该在其他之前声明, 以确保事件传播的正确性.

import androidx.compose.animation.AnimatedContentimport androidx.compose.animation.ExperimentalAnimationApiimport androidx.compose.foundation.ExperimentalFoundationApiimport androidx.compose.foundation.LocalIndicationimport androidx.compose.foundation.PointerMatcherimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.indicationimport androidx.compose.foundation.interaction.MutableInteractionSourceimport androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.sizeimport androidx.compose.foundation.onClickimport androidx.compose.material.Textimport androidx.compose.runtime.*import androidx.compose.ui.Alignmentimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.input.pointer.PointerButtonimport androidx.compose.ui.input.pointer.isAltPressedimport androidx.compose.ui.input.pointer.isshiftPressedimport androidx.compose.ui.text.style.TextAlignimport androidx.compose.ui.unit.dpimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalFoundationApi::class, ExperimentalAnimationApi::class)fun main() = singleWindowApplication {    Column {        var topBoxText by remember { mutableStateOf("Click me\nusing LMB or LMB + Shift") }        var topBoxCount by remember { mutableStateOf(0) }        // No indication on interaction        Box(modifier = Modifier.size(200.dp, 100.dp).background(Color.Blue)            // the most generic click handler (without extra conditions) should be the first one            .onClick {                // it will receive all LMB clicks except when Shift is pressed                println("Click with primary button")                topBoxText = "LMB ${topBoxCount++}"            }.onClick(                keyboardModifiers = { isShiftPressed } // accept clicks only when Shift pressed            ) {                // it will receive all LMB clicks when Shift is pressed                println("Click with primary button and shift pressed")                topBoxCount++                topBoxText = "LMB + Shift ${topBoxCount++}"            }        ) {            AnimatedContent(                targetState = topBoxText,                modifier = Modifier.align(Alignment.Center)            ) {                Text(text = it, textAlign = TextAlign.Center)            }        }        var bottomBoxText by remember { mutableStateOf("Click me\nusing LMB or\nRMB + Alt") }        var bottomBoxCount by remember { mutableStateOf(0) }        val interactionSource = remember { MutableInteractionSource() }        // With indication on interaction        Box(modifier = Modifier.size(200.dp, 100.dp).background(Color.Yellow)            .onClick(                enabled = true,                interactionSource = interactionSource,                matcher = PointerMatcher.mouse(PointerButton.Secondary), // Right Mouse Button                keyboardModifiers = { isAltPressed }, // accept clicks only when Alt pressed                onLongClick = { // optional                    bottomBoxText = "RMB Long Click + Alt ${bottomBoxCount++}"                    println("Long Click with secondary button and Alt pressed")                },                onDoubleClick = { // optional                    bottomBoxText = "RMB Double Click + Alt ${bottomBoxCount++}"                    println("Double Click with secondary button and Alt pressed")                },                onClick = {                    bottomBoxText = "RMB Click + Alt ${bottomBoxCount++}"                    println("Click with secondary button and Alt pressed")                }            )            .onClick(interactionSource = interactionSource) { // use default parameters                bottomBoxText = "LMB Click ${bottomBoxCount++}"                println("Click with primary button (mouse left button)")            }            .indication(interactionSource, LocalIndication.current)        ) {            AnimatedContent(                targetState = bottomBoxText,                modifier = Modifier.align(Alignment.Center)            ) {                Text(text = it, textAlign = TextAlign.Center)            }        }    }}

新的实验性onDrag修改器(仅适用于Desktop-JVM平台)

Modifier.onDrag allows for configuration of the pointer that should trigger the drag (see matcher: PointerMatcher).
Many onDrag modifiers can be chained together.

The example below also shows how to access the state of keyboard modifiers (via LocalWindowInfo.current.keyboardModifier) for cases when keyboard modifiers can alter the behaviour of the drag (for example: move an item if we perform a simple drag; or copy/paste an item if dragged with Ctrl pressed)

Modifier.onDrag允许配置应触发拖动的指针(见matcher: PointerMatcher). 许多onDrag修改器可以被连锁起来.

下面的例子还显示了如何访问键盘修改器的状态(通过LocalWindowInfo.current.keyboardModifier), 以应对键盘修改器可以改变拖动行为的情况(例如: 如果我们执行简单的拖动, 则移动一个项目; 如果按住Ctrl拖动, 则复制/粘贴一个项目)

import androidx.compose.foundation.ExperimentalFoundationApiimport androidx.compose.foundation.PointerMatcherimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.gestures.onDragimport androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.offsetimport androidx.compose.foundation.layout.sizeimport androidx.compose.material.Textimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.geometry.Offsetimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.input.pointer.PointerButtonimport androidx.compose.ui.input.pointer.isCtrlPressedimport androidx.compose.ui.platform.LocalWindowInfoimport androidx.compose.ui.unit.IntOffsetimport androidx.compose.ui.unit.dpimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalFoundationApi::class)fun main() = singleWindowApplication {    val windowInfo = LocalWindowInfo.current    Column {        var topBoxOffset by remember { mutableStateOf(Offset(0f, 0f)) }        Box(modifier = Modifier.offset {            IntOffset(topBoxOffset.x.toInt(), topBoxOffset.y.toInt())        }.size(100.dp)            .background(Color.Green)            .onDrag { // all default: enabled = true, matcher = PointerMatcher.Primary (left mouse button)                topBoxOffset += it            }        ) {            Text(text = "Drag with LMB", modifier = Modifier.align(Alignment.Center))        }        var bottomBoxOffset by remember { mutableStateOf(Offset(0f, 0f)) }        Box(modifier = Modifier.offset {            IntOffset(bottomBoxOffset.x.toInt(), bottomBoxOffset.y.toInt())        }.size(100.dp)            .background(Color.LightGray)            .onDrag(                enabled = true,                matcher = PointerMatcher.mouse(PointerButton.Secondary), // right mouse button                onDragStart = {                    println("Gray Box: drag start")                },                onDragEnd = {                    println("Gray Box: drag end")                }            ) {                val keyboardModifiers = windowInfo.keyboardModifiers                bottomBoxOffset += if (keyboardModifiers.isCtrlPressed) it * 2f else it            }        ) {            Text(text = "Drag with RMB,\ntry with CTRL", modifier = Modifier.align(Alignment.Center))        }    }}

也有非修改器方式来处理拖拽, 就是用suspend fun PointerInputScope.detectDragGestures:

import androidx.compose.foundation.ExperimentalFoundationApiimport androidx.compose.foundation.PointerMatcherimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.gestures.detectDragGesturesimport androidx.compose.foundation.layout.Boximport androidx.compose.foundation.layout.offsetimport androidx.compose.foundation.layout.sizeimport androidx.compose.material.Textimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.ExperimentalComposeUiApiimport androidx.compose.ui.Modifierimport androidx.compose.ui.geometry.Offsetimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.input.pointer.pointerInputimport androidx.compose.ui.unit.IntOffsetimport androidx.compose.ui.unit.dpimport androidx.compose.ui.window.singleWindowApplication@OptIn(ExperimentalFoundationApi::class)fun main() = singleWindowApplication {    var topBoxOffset by remember { mutableStateOf(Offset(0f, 0f)) }    Box(modifier = Modifier.offset {        IntOffset(topBoxOffset.x.toInt(), topBoxOffset.y.toInt())    }.size(100.dp)        .background(Color.Green)        .pointerInput(Unit) {            detectDragGestures(                matcher = PointerMatcher.Primary            ) {                topBoxOffset += it            }        }    ) {        Text(text = "Drag with LMB", modifier = Modifier.align(Alignment.Center))    }}

感谢各位的阅读,以上就是“Compose for Desktop鼠标事件源码分析”的内容了,经过本文的学习后,相信大家对Compose for Desktop鼠标事件源码分析这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是编程网,小编将为大家推送更多相关知识点的文章,欢迎关注!

--结束END--

本文标题: Compose for Desktop鼠标事件源码分析

本文链接: https://www.lsjlt.com/news/352067.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Compose for Desktop鼠标事件源码分析
    这篇文章主要讲解了“Compose for Desktop鼠标事件源码分析”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Compose for Des...
    99+
    2023-07-05
  • Compose for Desktop 鼠标事件示例demo
    目录鼠标事件涵盖的内容鼠标事件监听器点击监听器鼠标移动监听器鼠标进入监听器鼠标滚动监听器与Swing的交互操作在commonMain中通过Modifier.pointerInput监...
    99+
    2023-03-19
    Compose Desktop 鼠标事件 Compose Desktop
  • Java中MouseWheelListener的鼠标滚轮事件分析
    本篇内容主要讲解“Java中MouseWheelListener的鼠标滚轮事件分析”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Java中MouseWheelListener的鼠标滚轮事件分析”...
    99+
    2023-06-21
  • Redis事件处理源码分析
    今天小编给大家分享一下Redis事件处理源码分析的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下...
    99+
    2022-10-19
  • JS鼠标3次点击事件的示例分析
    这篇文章给大家分享的是有关JS鼠标3次点击事件的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。1、制作一个通用的事件处理模块(原生实现)以下实现基于AMD定义模块方式: ...
    99+
    2022-10-19
  • vue事件修饰符源码分析
    本篇内容主要讲解“vue事件修饰符源码分析”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“vue事件修饰符源码分析”吧!在项目开发中遇到了vue的键盘事件,以下是项目的代码片段:<div c...
    99+
    2023-07-05
  • AndroidViewGroup事件分发和处理源码分析
    目录正文处理ACTION_DOWN事件检测是否截断事件不截断ACTION_DOWN事件寻找处理事件的子View事件分发给子ViewViewGroup自己处理ACTION_DOWN事件...
    99+
    2023-02-14
    Android ViewGroup事件分发处理 Android ViewGroup源码分析
  • HTML5 Canvas鼠标与键盘事件demo的示例分析
    本篇文章给大家分享的是有关HTML5 Canvas鼠标与键盘事件demo的示例分析,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。 ...
    99+
    2022-10-19
  • 【Android】事件分发机制源码解析
    文章目录1. 分发顺序2.源码分析2.1 Activity中的分发流程dispatchTouchEventonTouchEvent总结2.2 V...
    99+
    2022-06-06
    事件 源码 Android
  • Netty分布式源码分析监听读事件
    前文传送门:NioSocketChannel注册到selector 我们回到AbstractUnsafe的register0()方法: private void register0(...
    99+
    2022-11-13
  • Windows 8技巧:Windows 8常用鼠标事件 分析介绍
      在Windows 8中采用一些新的鼠标事件以替代以前Silverlight的鼠标事件,其常用事件如下:   PointerWheelChanged:鼠标中键滑动事件。   PointerPressed:...
    99+
    2022-06-04
    鼠标 常用 事件
  • React实现合成事件的源码分析
    目录事件绑定事件触发结尾今天尝试学习 React 事件的源码实现。 React 版本为 18.2.0 React 中的事件,是对原生事件的封装,叫做合成事件。抽象出一层合成事件,是为...
    99+
    2022-12-08
    React实现合成事件 React合成事件
  • Android源码分析——ViewGroup的事件分发机制(二)
    通过前一篇博客View的事件分发机制,从dispatchTouchEvent说起(一)的介绍相信大家对 Android View 事件的分发机...
    99+
    2022-06-06
    事件 Android
  • Netty分布式pipeline传播inbound事件源码分析
    目录传播inbound事件这里给大家看两种写法我们先以写法2为例, 将这种写法进行剖析我们跟进invokeChannelRead方法:我们跟到invokeChannelRead方法中...
    99+
    2022-11-13
  • Vue组件中的自定义事件源码分析
    这篇文章主要介绍“Vue组件中的自定义事件源码分析”,在日常操作中,相信很多人在Vue组件中的自定义事件源码分析问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Vue组件中的自定义事件源码分析”的疑惑有所帮助!...
    99+
    2023-06-29
  • 深入分析React源码中的合成事件
    目录热身准备明确几个概念事件系统角色划分事件注册registerSimpleEventsregisterEvents$2registerEvents$1registerEvents$...
    99+
    2022-11-13
    React源码合成事件 React 合成事件 React合成
  • Android点击事件派发机制源码分析
    概述  一直想写篇关于Android事件派发机制的文章,却一直没写,这两天刚好是周末,有时间了,想想写一篇吧,不然总是只停留在会用的层次上但是无法了解其内部机制。我...
    99+
    2022-06-06
    事件 源码 Android
  • Laravel中的事件溯源实例代码分析
    这篇文章主要介绍了Laravel中的事件溯源实例代码分析的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Laravel中的事件溯源实例代码分析文章都会有所收获,下面我们一起来看看吧。我们将新建一个 Laravel...
    99+
    2023-07-04
  • Python selenium的基本元素与键盘鼠标模拟事件实例分析
    本篇内容主要讲解“Python selenium的基本元素与键盘鼠标模拟事件实例分析”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Python selenium的基本元素与键盘鼠标模拟事件实例分...
    99+
    2023-07-02
  • Netty源码分析NioEventLoop处理IO事件相关逻辑
    目录NioEventLoop的run()方法:processSelectedKeys()方法processSelectedKeysOptimized(selectedKeys.fli...
    99+
    2022-11-13
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作