Commit Graph

1399 Commits

Author SHA1 Message Date
Joel Martin 4529ec0176 README.md: Add OpenStack doc and video link. 2011-04-24 12:45:58 -05:00
Joel Martin 667ef9bae8 README.md: fix wiki links.
github changed something about relative links.
2011-04-24 12:34:09 -05:00
Joel Martin bbee8098c2 tests/browser.js: Missing. Needed for arrays.html test. 2011-04-21 08:45:04 -05:00
Joel Martin 41b9ae6ec9 Sync with websockify. Save handshake headers.
Derived classes will almost certainly want to make use of the raw
info.
2011-04-19 09:37:43 -05:00
Joel Martin eb6426b4bc input.js: remove redundant switch case statments.
Issue #21 - non-US key handling.
2011-04-15 08:48:04 -06:00
Joel Martin dc4131b14a input.js: uncomment special key handling for non-US keys.
Issue #21 - non-US keyboard layouts.

The code section for tab, backspace and enter was commented out for
testing but got checked in that way. Fix that.
2011-04-15 08:40:20 -06:00
Joel Martin b7c9657b83 include/input.js: change to LGPL-2 or later.
Requested by Alexander Larsson at Red Hat to allow incorporation of
solution into HTML5 gtk 3.0 backend.
2011-04-14 11:25:11 -06:00
Joel Martin fac149ddbe input.js: adjust special key handling for non-US keys.
Issue #21 - non-US keyboard layouts.

Only identify some keys as special during the keyDown event so that
when using non-US keyboards the values don't overlap with the values
for normal keys.

Some keys have to still be identified in both keyDown and keyPress
since they generate both: backspace and enter for Firefox and Opera,
tab for Opera.
2011-04-12 09:06:11 -05:00
Joel Martin 303819eaa9 util/json2graph.py: new location for json2graph.py.
Also clarify usage statement with legend height adjustment.

Remove console.log in arrays.js so that it works in firefox without
firebug.
2011-04-06 11:19:02 -05:00
Joel Martin 40e5c25ad8 utils/rebind, utils/u2x11: use /usr/bin/env 2011-04-06 10:05:59 -05:00
Joel Martin 0a92014700 include/webutil.js: fix dirObj undefined attribute. 2011-04-05 14:46:22 -05:00
Joel Martin d0c29bb679 Fix copyright year to 2011. 2011-04-05 14:44:47 -05:00
Joel Martin c96f900336 Refactor keyboard event handling.
This is part of addressing issue #21 - non-US keyboard layouts.

There are several challenges when dealing with keyboard events:
  - The meaning and use of keyCode, charCode and which depends on
    both the browser and the event type (keyDown/Up vs keyPress).
  - We cannot automatically determine the keyboard layout
  - The keyDown and keyUp events have a keyCode value that has not
    been translated by modifier keys.
  - The keyPress event has a translated (for layout and modifiers)
    character code but the attribute containing it differs. keyCode
    contains the translated value in WebKit (Chrome/Safari), Opera
    11 and IE9. charCode contains the value in WebKit and Firefox.
    The which attribute contains the value on WebKit, Firefox and
    Opera 11.
  - The keyDown/Up keyCode value indicates (sort of) the physical
    key was pressed but only for standard US layout. On a US
    keyboard, the '-' and '_' characters are on the same key and
    generate a keyCode value of 189. But on an AZERTY keyboard even
    though they are different physical keys they both still
    generate a keyCode of 189!
  - To prevent a key event from propagating to the browser and
    causing unwanted default actions (such as closing a tab,
    opening a menu, shifting focus, etc) we must suppress this
    event in both keyDown and keyPress because not all key strokes
    generate on a keyPress event. Also, in WebKit and IE9
    suppressing the keyDown prevents a keyPress but other browsers
    still generated a keyPress even if keyDown is suppressed.

For safe key events, we wait until the keyPress event before
reporting a key down event. For unsafe key events, we report a key
down event when the keyDown event fires and we suppress any further
actions (including keyPress).

In order to report a key up event that matches what we reported
for the key down event, we keep a list of keys that are currently
down. When the keyDown event happens, we add the key event to the
list. If it is a safe key event, then we update the which attribute
in the most recent item on the list when we received a keyPress
event (keyPress should immediately follow keyDown). When we
received a keyUp event we search for the event on the list with
a matching keyCode and we report the character code using the value
in the 'which' attribute that was stored with that key.

For character codes above 255 we use a character code to keysym lookup
table. This is generated using the util/u2x11 script contributed by
Colin Dean (xvpsource.org).
2011-04-05 14:26:54 -05:00
Joel Martin d1bd5ec7d4 Fix focus/clipboard related to mouse/keyboard refactor. 2011-04-03 17:51:47 -05:00
Joel Martin d3796c149e API change: Mouse/kbd handling to include/input.js
API change: for intergrators that explicitly include the Javascript
files (that do not use include/vnc.js)js, include/input.js is a new
file that must also be included.

The mouse and keyboard handling could be useful on its own so split it
out into a Keyboard and Mouse class in include/input.js.

This refactoring is preparation to deal with issue #21 - non-US
keyboard layouts.
2011-04-03 17:30:45 -05:00
Joel Martin dec1861127 Merge branch 'master' of git@github.com:kanaka/noVNC 2011-03-29 15:47:58 -05:00
Joel Martin f899070482 IE9 fixes: mouse, doctype. Adobe Flash link.
Fix mouse button mapping in IE9. All browsers have converged on
a standard left=0, middle=1, right=2 ... all except IE that is.

Add html5 doctype to tests.

In vnc_perf test, use do_test instead of start for function name since
start is a keyword in IE.

In error about Flash give a link to Adobe's download page.
2011-03-29 15:44:03 -05:00
Phil Phillips e9155818c8 Make scripts more compatible across OSes 2011-03-27 04:18:08 +08:00
Joel Martin 0b6292b8c0 No exception if noVNC_logo is undefined. 2011-03-25 09:01:53 -05:00
Joel Martin 8a377d7a95 Ignore utils/rebind.so 2011-03-23 21:23:08 -05:00
Joel Martin 81bcf70fdc Higher connectTimeout default with web-socket-js.
Current timeout is 2 seconds for connect timeout. Use 5 seconds if
web-socket-js (Flash WebSockets emulator) is being used. On Windows XP
with Flash 10.2.152.26, connecting seems to take quite a bit longer
than it probably should. This should make it work more consistently.
2011-03-22 14:24:55 -05:00
Joel Martin bbd21ca7b5 Update web-socket-js to bb5797cad.
Syncs with same change to websockify (7534574a2f).

Primary change is removal of FABridge interface.

Seems to improve overall latency by perhaps 10%. Also, the slowdown
over time in Opera is about half as bad (but still there).
2011-03-16 10:33:01 -05:00
Joel Martin 5e55378b6e test/*.html: use "../include" instead of symlink.
This allows tests to work on the github pages site.
2011-03-14 19:05:42 -05:00
Joel Martin 468a9cc44a tests/keyboard.html: fix getKeysym call. 2011-03-14 18:54:16 -05:00
Joel Martin 1506a5ed54 Clarify license on arrays test files. 2011-02-23 14:48:23 -06:00
Joel Martin d3da7c4c4f Add Javascript binary byte array test.
Compares normal Javascript arrays with Canvas ImageData arrays and
Typed Arrays (ArrayBuffers from WebGL).
2011-02-23 11:08:09 -06:00
Joel Martin 43cf7bd83b Some JSLint'ing 2011-02-19 16:44:10 -06:00
Joel Martin 9b8f457b6b Add OpenNode to README. Update TODOs. 2011-02-05 13:03:12 -06:00
Joel Martin 159ad55d03 Add logo, favicon.
Thanks to Michael Sersen for creating images/Logo.svg.

- Add images directory with original SVG logo, favicon, and some
  derivative PNGs of the logo for different purpose.

- Note that license on images/* is CC BY-SA.

- Add utils/img2js.py to take an image and generate a base64 encoded
  data URI string.

- Add base64 encoded data URI screen logo to display in canvas when
  disconnected.
2011-02-03 11:04:32 -06:00
Joel Martin 0f354fb682 Fix CSS sizes with HTML5 doctype.
Using HTML5 doctype means CSS pixels sizes must have "px" suffix which
many of them did not. Fix that.
2011-02-02 10:48:29 -06:00
Joel Martin 215ae8e564 Better reaper, catch occasional bad WS header line.
Call waitpid in loop to catch SIGCHLD signals that happen while
handling the original SIGCHLD signal.

Pulled from websockify.
2011-02-01 10:47:45 -06:00
Joel Martin ec2b614037 Pull websockify: zombie reap, ignore unready clients. 2011-01-31 12:13:30 -06:00
Joel Martin 40f281ebbd Add DOCTYPE. Misc cleanup. 2011-01-30 23:42:28 -06:00
Joel Martin 0981845ec4 IE9 fixes. Works but slow. API change.
API change: changed include path variable from VNC_uri_prefix to
URI_INCLUDE since websock.js uses the variable and websock.js is no
longer just for noVNC (i.e. websockify is really the canonical
location for websock.js).

Changes to get web-socket-js to work. Right now it's a hack to get
around: https://github.com/gimite/web-socket-js/issues#issue/41. The
hack is to disable caching of the flash objects by appending
"?" + Math.random() to the end of the flash object path (but only when
using IE).
2011-01-30 22:58:22 -06:00
Joel Martin 7cc5fbc52e Opera 11 WebSockets and Opera '-' key mapping fix.
Opera 11 native WebSockets (if enabled) seems to have bad behavior for
the bufferedAmount so add change from websockify project to allow max
bufferedAmount (before send queue is delay) to be configured.

Also, Opera 11 and 10.60 behave like Mozilla regarding the '-' key so
translate it correctly.
2011-01-23 19:36:11 -06:00
Joel Martin 1756a30a48 websock.send returns true/false.
If all send data was flushed from the send queue then return true,
otherwise false. This doesn't mean the data won't be sent, just that
it wasn't sent this time and is queued.
2011-01-23 19:21:04 -06:00
Joel Martin 8b502df2a1 Tolerate some bufferedAmount.
Only delay sending data if bufferedAmount is greater than 1000.

This seems to match the intention of the spec better. bufferedAmount
does not mean that we can't send, it's just an indication that the
network is becoming saturated. But Opera 11 native WebSockets seems to
have a bug that bufferedAmount isn't set back to zero correctly so
we'll be a bit more tolerant.
2011-01-23 19:17:59 -06:00
Joel Martin cabecf8964 canvas.js: prevent Opera keyboard event bubbling.
Issue #8: https://github.com/kanaka/noVNC/issues#issue/8
2011-01-19 13:09:32 -06:00
Joel Martin b43c9838a5 web-socket-js: Add function invocation fix.
Related to this issue:
https://github.com/gimite/web-socket-js/issues/#issue/50

This prevents the "Uncaught exception: TypeError:
'this.__handleEvents' is not a function" everytime the timer fires.

Yay, one of Javascript's worst behaviors; the way it sets "this".
2011-01-19 13:01:28 -06:00
Joel Martin 9a23006e7a include/canvas.js: fix changeCursor data format.
Issues #27 (safari cursor rendering messed up) and #29 (firefox 3.6.10
segault).

Finally found some better reference on the icon/cursor format which is
added to the docs/links file.

It seems like I was missing the XOR section. So setting the cursor
would cause corruptin in Safari rendering or the segfault for firefox.
2011-01-18 23:22:25 -06:00
Joel Martin 9df83a3953 Move advanced, integration, troubleshoot to wiki.
Move the Advanced Usage, Integration and Troubleshooting sections to
their own pages in the wiki.

Also, update wsproxy.py referneces to be websockify.
2011-01-18 14:19:55 -06:00
Joel Martin 2840026468 include/canvas.js: add numpad support to getKeysym.
Check keyLocation and translate numpad keys into numbers. keyLocation
is not widely supported yet, but it should start percolating into
browsers eventually:
http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent

This change is based on:
8e59e3772c
2011-01-18 12:16:50 -06:00
Joel Martin 0a9f04241e Move browsers.md to Wiki.
It is now here: https://github.com/kanaka/noVNC/wiki/Browser-support
2011-01-18 11:58:24 -06:00
Joel Martin febae871ab tests/vnc_perf.html: load from data/multi.js
To go along with addition of performance notes to the website.
2011-01-17 11:46:55 -06:00
Joel Martin 30b0c00875 Misc docs/{TODO,links} updates. 2011-01-16 19:27:32 -06:00
Joel Martin 24d01a5aa4 Update gimite/web-socket-js build.
Update to a build based on 20f837425d4 from gimite/web-socket-js.

This changes the event handling code and fixes the frequent recursive
call into Flash errors.
2011-01-16 19:05:58 -06:00
Joel Martin 1b097a63a3 Fix strict mode complaints in firefox 4. 2011-01-16 18:57:45 -06:00
Joel Martin 72f1348b35 Convert to Websock library.
Copy in include/websock.js from websockify and use that instead. Still
some cleanup of network code but it's a good start.
2011-01-13 00:30:08 -06:00
Joel Martin 61265b3a7f Remove files that are now in websockify.
https://github.com/kanaka/websockify is now the canonical location of
websockify (formerly wsproxy). A copy of the python version is kept
here for backwards compatibility and ease-of-use. The other versions
and related test scripts are in websockify.
2011-01-12 20:31:04 -06:00
Joel Martin 66937e399a wsproxy.py: python2.4 fixes. 2011-01-12 18:12:17 -06:00