zoukankan      html  css  js  c++  java
  • Adding right click to Silverlight

    by Morten 5/9/2009 6:10:00 PM

    In an earlier post, I created a small extension library that added several mouse gestures to Silverlight. However, the right-click only worked in Internet Explorer, and the solution was a bit of a hack. So to continue down the road of hacks, I found that there is a way to prevent the Silverlight Plugin from getting the right click event. By inserting a <div> on top of the plugin when the right mousebutton down event fires, you can prevent the mozilla browsers from getting the rightclick event. The mouseup event is then fired on this overlay div, and we remove the overlay again when the button is released or the mouse moves. Ugly but it works... The approach still requires the plugin to run in windowless mode.

    Of course whether you even should be preventing the user from getting to the silverlight context menu in the first place is a whole different discussion.

    I've updated the demo page, source and binary:

    Try a demo!

    Download binary (7 kb)

    Download source (25 kb)


  • 相关阅读:
    每日总结59
    每日总结58
    每日总结57
    每日总结56
    每日总结55
    每日总结54
    每日总结53
    每日总结52
    学习日报
    学习日报
  • 原文地址:https://www.cnblogs.com/HeroBeast/p/1559414.html
Copyright © 2011-2022 走看看