      return win.inputModes[mode];
    },
  
-@@ -1280,13 +1446,49 @@ var LibraryGLFW = {
+@@ -1280,13 +1449,49 @@ var LibraryGLFW = {
      GLFW.setScrollCallback(winid, cbfun);
    },
  
 -  glfwJoystickPresent: function(joy) { throw "glfwJoystickPresent is not implemented."; },
 +  glfwJoystickPresent: function(joy) {
 +    GLFW.refreshJoysticks();
- 
--  glfwGetJoystickAxes: function(joy, count) { throw "glfwGetJoystickAxes is not implemented."; },
++
 +    return GLFW.joys[joy] !== undefined;
 +  },
- 
--  glfwGetJoystickButtons: function(joy, count) { throw "glfwGetJoystickButtons is not implemented."; },
++
 +  glfwGetJoystickAxes: function(joy, count) {
 +    GLFW.refreshJoysticks();
- 
--  glfwGetJoystickName: function(joy) { throw "glfwGetJoystickName is not implemented."; },
++
 +    var state = GLFW.joys[joy];
 +    if (!state || !state.axes) {
 +      setValue(count, 0, 'i32');

     setKeyCallback: function(winid, cbfun) {
       var win = GLFW.WindowFromId(winid);
       if (!win) return;
@@ -658,6 +741,64 @@ var LibraryGLFW = {
       win.scrollFunc = cbfun;
     },
 

+    },
+
+    onDrop: function(event) {
+      if (!GLFW.active || !GLFW.active.dropFunc) return;
+      if (!event.dataTransfer || !event.dataTransfer.files || event.dataTransfer.files.length == 0) return;
+
+      event.preventDefault();
+
