English 中文(简体)
Sato Mac OSX Backspace Issues
原标题:Safari Mac OSX Backspace Issues

Is there anyone out there who knows how to handle the behavior of Safari Web Browser that sets the current page to the previous page whenever users were pressing backspace key? I m currently experiencing this issue on Mac OSX Lion 10.7.2 and a silverlight application whenever our users were trying to correct fields using the backspace/Delete key.

最佳回答

我过去也存在这一问题。 我花了一个好星期或这样时间来寻求解决办法,并最终找到解决这一问题的最佳办法(我从未找到这样说的“解决办法”)是:

  1. 利用Javascript将所有后空关键事件都予以搁置。 Don t允许任何后天活动进入银灯集装箱。 这意味着,银星从来不会再把你带往前页,但你也未能删除案文领域的任何案文! 第2点解释了如何围绕这一点开展工作。

  2. Attach a KeyUp event handler to the RootVisual of your Silverlight control. KeyEventArgs original source is a TextField and the key itself was Key.Back, then we must delete some text inside of the textbox manually. We do this by looking at the TextBox s SelectionStart and SelectionLength properties. SelectionStart gives you the location you want to delete from, and SelectionLength gives you how many characters you want to delete. Finally, you need to work out the correct location of where the cursor should be now. This should just be equal to the SelectionStart property s value.

这种做法存在缺陷。 由于我们必须人工聆听<代码>KeyUp的各项活动,Key.Back 。 只有在释放后空钥匙时才发生事件。 这意味着,如果你正在使用Safari,而后退,只有一种特性将被删除。 你们需要释放后天空,并再次敦促它删除另一种性质。 我认为,这是一种小的代价,尽管考虑到其他选择是看上页或根本不处理后天!

值得注意的是,所有这些都可能是澳门特区。 页: 1 用户代码,以找到浏览器类型,只附上<代码> 如果浏览器是Safari,则根基斯底_KeyUp。 如果你只暂停在Safari的javascript上的回航活动,这只会在Mac/Safari产生作用,并使所有其他浏览器都保持违约功能。

Good Luck! 希望这一帮助!

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签