unity indicator下菜单自定义的解决方法

       因为unity目前对于indicator采用的是极简的处理方法,无论是qt还是gtk,所能使用的调用只有单一的Trigger点击,想要用到复杂的比如右键点击,左键双击等等的操作响应暂时还没想到办法。事实上,默认的音量控制(indicator-sound)是有各种响应的,比如鼠标中键的滚轮滚动可以调节音量。首先,我们要找到它的实现方法。

         indicator使用dbus作为通信机制。所以当打开dbus-monitor后,在滚动滚轮调节音量时,有如下输出(ps:真难截。。)

method call sender=:1.17 -> dest=:1.43 serial=8609 path=/com/canonical/Unity/Panel/Service; interface=com.canonical.Unity.Panel.Service; member=ScrollEntry
   string "0x8863a84"
   int32 -120
method call sender=:1.43 -> dest=:1.29 serial=18226 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "indicator-sound"
   uint32 0
   string "notification-audio-volume-low"
   string "indicator-sound"
   string ""
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值