      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');

+    },
+
+    onDrop: function(event) {
+      if (!GLFW.active.dropFunc) return;
+
+      event.preventDefault();
+

     Module["canvas"].addEventListener("mousemove", GLFW.onMousemove, true);
     Module["canvas"].addEventListener("mousedown", GLFW.onMouseButtonDown, true);
     Module["canvas"].addEventListener("mouseup", GLFW.onMouseButtonUp, true);
@@ -951,6 +1100,8 @@ var LibraryGLFW = {
     Module["canvas"].addEventListener('mousewheel', GLFW.onMouseWheel, true);
     Module["canvas"].addEventListener('mouseenter', GLFW.onMouseenter, true);
     Module["canvas"].addEventListener('mouseleave', GLFW.onMouseleave, true);
+    Module["canvas"].addEventListener('drop', GLFW.onDrop, true);
+    Module["canvas"].addEventListener('dragover', GLFW.onDragover, true);
 
     Browser.resizeListeners.push(function(width, height) {
        GLFW.onCanvasResize(width, height);
@@ -959,9 +1110,12 @@ var LibraryGLFW = {
   },
 
   glfwTerminate: function() {
