ALT capturing in Flex apps (yet again) - apache-flex

I know there have been similar threads in the past but I can't seem to find a decent definitive answer / workaround for the problem I'm facing.
What I'm trying to do:
capture ALT+SHIFT+something keyboard events. Pretty straightforward, right?
Issue:
When pressing ALT+SHIFT doesn't seem to ever shoot an event. The only combination that seems to work with ALT is CTRL+ALT+something, as pointed out here.
Question:
really? I've read that the browser catches some of the keyboard events, but this happens with the basic flash player too - maybe that catches events too? Would love to know if there is a solution that doesn't involve messing with JS.
thank you!

The problem as you've said is that the browser captures some of the key combinations, and the underlying OS may catch others. From the research I've done, and read about on the bug on Adobe's bug base I filed on this, it can be made better if you do an Air app, but even then there are some of these combinations that are just eaten by the OS, so it never even comes NEAR your application.

Related

Play Youtube video from Flex app

I was wondering if anyone had any advice on what the best way to embed a youtube player inside a flex app is. I've looked around and it seems that one can
Try to use SWFLoader (as with what's described here) but this ends up throwing crossdomain violations
Use the YouTuve API
Ideally use the Spark VideoPlayer component, although I have not been able to figure out how to play a YouTube video through it and am starting to think that it is, in fact, not possible.
Would love to hear any thoughts from those of you out there that have done this in the past.
thank you!
I think, the most convenient way is using youtube api. Check this turotial.
SWF-Loader cross-domain exceptions, add the following line to your code, BEFORE the player gets initialized.
Security.allowDomain("www.youtube.com");
Ok, after trying a variety of things, I've come to the conclusion that the Youtube API is probably the best way to go, but it doesn't work very well, at least it seems to have all sorts of issues in Flex 4 (see for instance http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/f8e61440e5f1a21c/9ed01ed5fd6eb71b). The interesting thing is that the serious security errors seem to happen only if you move the mouse pointer over the Application stage. So if you can stomach to cover your whole application with something (at least a rect wrapped in a group) you should be ok. Ugly as hell, but that seems to be the only way I can find to make this work.

Need to disable an array of ctrl keys for my site

Especially Ctrl+I , which is "mail this page". I'm using wordpress self hosted. So far I've found this code, not sure how to implement it or if it's old.
Please no plethora of reasons as to why you find this attempt pointless.
Really, shouldn't answer, but:
There's no reason for this, because there's always a very easy way around it. It'll probably take a lot more work than whatever you end up with's worth. If somebody has half of a computer literate mind, they probably can get past this without a problem at all.
Summary:
Don't bother
Disabling hotkeys won't stop anyone from just selecting that option from the File menu.
People will always find ways around these kinds of hacks. Turning off JavaScript, hacking the source with Firebug, Option+Click on a Mac, taking a screenshot, etc. They are completely ineffective against anyone even slightly determined to do what you don't want them to do.
You can't really do that. See this page for really good information on the portability of various key events in JavaScript across multiple browsers. You will see for one that each browser handles/responds to various key events in many different ways.
Also, most of the default browser actions (e.g. Ctrl-F, Ctrl-S) cannot be canceled if you are capturing key events. You can still detect some of them and respond, but you can't actually stop the browser from displaying the search dialog or whatever specific action is to be performed by the key combination.
Also, if someone really wants to take your page's HTML/JavaScript code or content, these methods won't stop them. The disable right click code from the link you referenced can prevent right click, but all someone has to do is disable javascript and it no longer works.

Visual Studio 2010: Editor stops responding to keyboard

I've got this very odd bug that appears to be a quirk in Visual Studio 2010: Sometimes, when moving the cursor into double quotes of a CSS style="" attribute the cursor refuses to move. I can't type anything, and the keys that respond are the UP/DOWN cursor keys and the DEL key (but not BACKSPACE).
Typing does nothing, but pushing LEFT/RIGHT on the cursor keys produces the following error:
The operation could not be completed
I've got no idea what's causing this, but I would hazard a guess that Intellisense is getting very confused and bugging out.
At the moment, whenever this happens, I have to write any CSS outsite of the double quotes of the style attribute and then place the cursor where I want the CSS to appear (using the mouse) and press CTRL-V to paste it in. Very annoying :(
There must be a way of fixing this problem...?
Hopefully someone has an answer!
Just encountered the issue in VS 2012, in editing C#.
I noticed that the problem had occurred soon after the trial period of Resharper has ended and i inserted a valid license number. It also happened in only some of the source files.
The solution: Tools->Options->Resharper: Suspend.
Try typing - should work now.
Then: Tools->Options->Resharper: Resume.
Problem gone.
I have encountered this using Visual Studio 2013 and Resharper 8.2.1. None of the solutions provided in this thread worked (even suspending and resuming Resharper)
After contacting JetBrains support, it turned out to be a caching issue.
Deleting all the files from the following directory solved the issue, as Resharper re-creates new caches:
C:\Users\[Username]\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches\[Project_reference]
I have some odd issues with the editor occasionally, a workaround for me is:
Ctrl-Tab (x2) to another code file and back to the same code (or alt tab to another app and back, one of these two... can't replicate issue to be sure)
An ultimate solution might be a re-install.
Microsoft have had variations on this problem reported quite a few times via their support portal. Here is one post and if you scroll down you will see a comment with a bunch of other reports all detailing similar(ish) problems.
Microsoft doesn't seem to be able to reproduce the problem but are "duping all the similar keyboard locking problems to a central bug, so that we can think a way to log the events if necessary". Which seems to be a generic response to a lot of these posts. Some people reported that it was simply becuase another window/pane/tab was in focus but I can see the OP obviously did not have this specific problem. Looks to me like one of those random unresolvable bugs. Hope I never get it! There's also numerous forum posts around the Internet, where users stated that removing certain 3rd party plugins has solved this issue.
I just spotted this particular post which has a possibly useful comment on it for you (which also link to this SO post. As I do not have the bug I cannot test its validity for you. The main point of it seems to be something about the keyboard layout switching.
I'm sorry for putting all this into an answer when technically it is not an answer and just a mass of research, but there was no way this was gonna fit into a comment. And also sorry for pretty much link spamming, but again there was no way I could extract everything that they said into this post. I hope there is something useful in there for you :)
EDIT: You should probably check the top rated answer below as this seems to solve a number of peoples issues, although I never had the Resharper plugin and still occasionally experienced this, but now I'm on VS2013 and have not had this problem re-occur, so maybe they fixed it...
Empty the solution cache folder
C:\Users\{UserName}\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches\
This was suggested by JetBrains support when I contacted them.
Permanently fixing... Not too sure however I found that pressing pressing Ctrl+Shift+Caps Lock+Tab all at once seems to get rid of this and enables the mouse and keyboard again. I know this isn't the best of solutions but it works.
I have the same problem several times a day. I didn't notice it until I installed the web essentials extension. I just uninstalled it and will see what happens. I have tried reinstalling visual studio with no joy (but again, I didn't notice the problem until after I had already installed the various extensions).
Sometimes, closing and re-opening the specific code window I'm working in fixes it. If that fails, sometimes I close all windows and reopen just the one I was actively editing. If all of that fails it usually requires a complete restart of visual studio.
I find it funny that MSFT says that they can't duplicate the problem. Scott Guthrie experienced it first hand during his MVC4 beta demo here at about 28 minutes in.
UPDATE: So far, as of 4-5-2012 9:33am Central Time, the problem hasn't recurred since uninstalling Web Essentials. This is the longest I've gone without this bug occurring. If I make it through the next 24 hours, I'll be confident in blaming Web Essentials.
UPDATE: 4-6-2012 10:05am Central Time: Well, apparently it wasn't Web Essentials. It happened to me again this morning editing the contents of a block in my _Layout.vbhtml file. Closing the tab and reopening it fixed it.
I frequently encounter this editor freeze, not just on CSS quotes but any file arbitrarily. I have a dual monitor setp and I have the doucment windows one one monitor and all tool windows on the next one. Sometimes, certain tool windows would freeze too (i.e. not respond to click).
Previously, I used to shutdown/restart IDE; but serendipitously, I discovered that switching to/from Full Screen mode, restores sanity. So now everytme I see a freeze, mode switching comes to rescue.
Not sure if this will solve your issue, but worth a shot.
Rant: In general, I find this new WPF based product very falky and unstable than its predeccessors.
I have the same problem on IDE, some times the Return key is not working at all...
My solution is: CLEAN the project/solution.
BTW: CLEANing resolve also other unexpected behaviours after amendements on CSS or HTML.
I tried every other workaround here but nothing seemed to work, and the issue was only present in one solution but not another.
Disabling Resharper fixed it temporarily but it came back after re-enabling it which wasn't a viable long-term solution.
What worked for me was disabling all Resharper Extensions (Under Resharper -> Extension Manager). I was able to type again even after re-enabling all of them, so I'm unsure which extension specifically caused the issue, but that's another route to try for people who still have this issue.
I never had the problem until I installed plugins/extensions. Curious to know if anyone has had this problem without having any plugins/extensions installed. I don't know if they are the actual cause but since benefits of the plugins outweigh the occasional lockup, I have left them installed. BTW, I use the "closing/reopening of the window with the lockup" technique.
Using a source control (GIT, AKSVN)? If so, disable it, restart VS then enable it and open the solution again.

Logging a user session for playback

Running an MVC2 site against IIS7 and would like to capture more detail of how users traverse the site - ideally to the point of being able to replay even the duration between mouse clicks - feedback of where people pause and/or backtrack.
I could do this with flash but that's no longer an option. Now it's just IIS7 via asp.net f4. IIS7 _should be able to provide this via 3rd party extensions - especially for this sort of niche need. I'm willing to consider client-side .net components but this sure seems to be the responsibility of the server.
[opps...does this belong on serverfault?]
thx
justSteve. Here is a solution that we have used:
http://www.seevolution.com/
I don't think that it gives time between clicks, but it does give very detailed tracking considering it's price (I don't know if that's an issue). We have really liked it. Fantastic detail.
You could also roll your own solution. Using jQuery and the $(document).click() function, you can log when they click, and the points on the screen. Then every couple of minutes, serialize it and fire it off to the server. You can get extremely fine-grained detail that way. The nice thing with seevolution is that they've done all of the work for you already, but it probably isn't as detailed as you would like.
JMax
Maybe not the "in-house" solution you're after but we are about to implement SessionCam at my company, which seems like a pretty good match for what you're looking for. Not having actually finished implementing it yet, I can't vouch for it in terms of quality at this point - but the description of the product certainly matches.
You aren't going to be able to capture the level of detail you need using a solely server-side solution. There needs to be a degree of client-side work - whether it's in flash or javascript - to capture things such as where the mouse is hovering (for heatmaps etc).
I personally haven't used this product, but a friend of mine spoke highly of it.
Clicktale

Flex Text Control Undo

I'm having trouble finding any resource for adding ctrl-z undo capability to a Flex RichTextEditor control (a lack it apparently shares with other Flex text controls). I'm baffled that it's not in the native forms because it's such a fundamental capability, available in even standard browser text controls I believe.
Any mention of this issue on the Flex sites (there are several) conflict; one says the issue is "Closed" and the resolution is "External" (whatever that means).
Does anyone have any insight to offer? I've got an app the heavily requires extensive text editing. Flex in general works nicely, but this trivial lack is just about fatal, as anyone would imagine.
An example using the Flight Framework to easily implement undo/redo can be found here: http://www.xtyler.com/code/163
I've read elsewhere -- in fact, in the answers to one of my questions on SO -- that the issue is not going to be resolved in Flex 3. Which seems to be correct since we are in 3.2 or maybe even beyond that, and there's no undo in sight.
I was brave/stupid enough to implement an undo-redo in this component myself. At that time I was working on Windows. Now I'm on OSX and I realize just how non-cross-platform my solution is. The very statement of the problem (adding ctrl-z undo capability) is a large part of the problem (OSX has control AND this Apple key thing). Now I have to check how much work it would be to make the thing cross-platform... could be trivial.
By amazing coincidence, just today I've been thinking about NOT using the RichTextEditor but rather something external (FckEditor comes to mind) because the RTE leaves so much to be desired (hence I arrived at your question). I've worked with the RTE a ton and gotten it to do a lot of what I want, but I still wonder why they didn't "finish" this component...
Flex 3 controls do not natively support undo/redo. Here are a couple of libraries that may be of interest to you:
flexundoredo
as3undohistory

Resources