support event handlers

akkartik
Nov 22, 2023, 3:21 AM
6DJMOJKEO5DIOEDV655SPA7C7HN2HXWMDJ7UF2CRDRBAF5YO3UEAC

Dependencies

  • [2] OZ42YLXG pop keyboard back up on touchscreens
  • [3] FYX6DG22 bugfix: stop dragging output scrollbar on mouse up
  • [4] ZOLCTAGU get rid of an assertion
  • [5] JV27LDDK sliders for font size and color settings
  • [6] 5RUFNRJO start of the visual skeleton
  • [7] TEDSEOCW send editor clicks to the left of the scrollbar
  • [8] VAVXKWZV aggregate global state inside a 'pane' object
  • [9] IP4LD33D mouse events for scrollbar
  • [10] UEG224LH debug animations
  • [11] PRE6XPRN responsively increase/decrease font height
  • [12] Z5M23NTK implement second, 'output' editor
  • [13] ZM7NOBRM new fork: carousel shell
  • [*] R5QXEHUI somebody stop me
  • [*] WR2WMEPE implement 'Run' button
  • [*] RK2ASPN7 add lots of buttons to the toolbar

Change contents

  • file addition: 0101-on.mouse_wheel_move (----------)
    [15.2]
    on.mouse_wheel_move = function(dx,dy)
    if Show_code then
    -- nothing yet
    else
    -- editors hidden
    if car.mouse_wheel_move then car.mouse_wheel_move(dx,dy) end
    if car.wheelmoved then car.wheelmoved(dx,dy) end
    end
    end
  • file addition: 0100-car (----------)
    [15.2]
    -- Table where any handlers for the current pane will live.
    car = {}
  • replacement in 0017-on.mouse_release at line 3
    [5.5822][6.2424:2987](),[6.2259][6.2424:2987](),[6.2987][3.61:117](),[3.117][6.2987:3120](),[6.2987][6.2987:3120]()
    if Current_pane.editor_state.scrollbar_drag then
    adjust_scrollbar(Current_pane.editor_state, y)
    Current_pane.editor_state.scrollbar_drag = nil
    elseif on_editor_scrollbar_area(Current_pane.editor_state, x,y) then
    adjust_scrollbar(Current_pane.editor_state, y)
    elseif x < Current_pane.editor_state.right + 15 - 5 and y < Current_pane.editor_state.bottom + 5 + 10 - 5 then
    edit.mouse_release(Current_pane.editor_state, x,y, mouse_button)
    elseif Current_pane.output_editor_state.scrollbar_drag then
    adjust_scrollbar(Current_pane.output_editor_state, y)
    Current_pane.output_editor_state.scrollbar_drag = nil
    elseif on_editor_scrollbar_area(Current_pane.output_editor_state, x,y) then
    adjust_scrollbar(Current_pane.output_editor_state, y)
    [5.5822]
    [6.1416]
    if Show_code then
    if Current_pane.editor_state.scrollbar_drag then
    adjust_scrollbar(Current_pane.editor_state, y)
    Current_pane.editor_state.scrollbar_drag = nil
    elseif on_editor_scrollbar_area(Current_pane.editor_state, x,y) then
    adjust_scrollbar(Current_pane.editor_state, y)
    elseif x < Current_pane.editor_state.right + 15 - 5 and y < Current_pane.editor_state.bottom + 5 + 10 - 5 then
    edit.mouse_release(Current_pane.editor_state, x,y, mouse_button)
    elseif Current_pane.output_editor_state.scrollbar_drag then
    adjust_scrollbar(Current_pane.output_editor_state, y)
    Current_pane.output_editor_state.scrollbar_drag = nil
    elseif on_editor_scrollbar_area(Current_pane.output_editor_state, x,y) then
    adjust_scrollbar(Current_pane.output_editor_state, y)
    end
    else
    -- editors hidden
    if car.mouse_release then car.mouse_release(x,y, mouse_button) end
    if car.mousereleased then car.mousereleased(x,y, mouse_button) end
  • replacement in 0016-on.mouse_press at line 11
    [5.5962][6.3207:3388](),[6.1753][6.3207:3388](),[6.2314][6.1530:1543](),[6.3388][6.1530:1543](),[6.1530][6.1530:1543](),[6.1543][6.3389:3501](),[6.3501][2.62:97](),[2.97][6.3501:3772](),[6.3501][6.3501:3772](),[6.3772][6.2482:2495](),[6.2482][6.2482:2495]()
    if on_editor_scrollbar(Current_pane.editor_state, x,y) then
    Current_pane.editor_state.scrollbar_drag = true
    elseif on_editor_scrollbar_area(Current_pane.editor_state, x,y) then
    -- nothing
    elseif x < Current_pane.editor_state.right + 15 - 5 and y < Current_pane.editor_state.bottom + 5 + 10 - 5 then
    love.keyboard.setTextInput(true)
    edit.mouse_press(Current_pane.editor_state, x,y, mouse_button)
    elseif on_editor_scrollbar(Current_pane.output_editor_state, x,y) then
    Current_pane.output_editor_state.scrollbar_drag = true
    elseif on_editor_scrollbar_area(Current_pane.output_editor_state, x,y) then
    -- nothing
    [5.5962]
    [6.1601]
    if Show_code then
    if on_editor_scrollbar(Current_pane.editor_state, x,y) then
    Current_pane.editor_state.scrollbar_drag = true
    elseif on_editor_scrollbar_area(Current_pane.editor_state, x,y) then
    -- nothing
    elseif x < Current_pane.editor_state.right + 15 - 5 and y < Current_pane.editor_state.bottom + 5 + 10 - 5 then
    love.keyboard.setTextInput(true)
    edit.mouse_press(Current_pane.editor_state, x,y, mouse_button)
    elseif on_editor_scrollbar(Current_pane.output_editor_state, x,y) then
    Current_pane.output_editor_state.scrollbar_drag = true
    elseif on_editor_scrollbar_area(Current_pane.output_editor_state, x,y) then
    -- nothing
    end
    else
    -- editors hidden
    if car.mouse_press then car.mouse_press(x,y, mouse_button) end
    if car.mousepressed then car.mousepressed(x,y, mouse_button) end
  • replacement in 0015-on.key_release at line 2
    [6.2551][4.0:105]()
    if Current_pane.editor_state.cursor_x then
    edit.key_release(Current_pane.editor_state, key, scancode)
    [6.2551]
    [4.105]
    if Show_code then
    if Current_pane.editor_state.cursor_x then
    edit.key_release(Current_pane.editor_state, key, scancode)
    end
    else
    -- editors hidden
    if car.key_release then car.key_release(key, scancode) end
    if car.keyreleased then car.keyreleased(key, scancode) end
  • replacement in 0014-on.text_input at line 2
    [6.2676][4.111:203]()
    if Current_pane.editor_state.cursor_x then
    edit.text_input(Current_pane.editor_state, t)
    [6.2676]
    [4.203]
    if Show_code then
    if Current_pane.editor_state.cursor_x then
    edit.text_input(Current_pane.editor_state, t)
    end
    else
    -- editors hidden
    if car.text_input then car.text_input(t) end
    if car.textinput then car.textinput(t) end
  • replacement in 0013-on.keychord_press at line 8
    [6.2244][4.209:303](),[4.303][6.4012:4073](),[6.2250][6.4012:4073]()
    elseif Current_pane.editor_state.cursor_x then
    -- send keys to editor if cursor is visible
    edit.keychord_press(Current_pane.editor_state, chord, key)
    [6.2244]
    [6.2298]
    elseif Show_code then
    if Current_pane.editor_state.cursor_x then
    -- send keys to editor if cursor is visible
    edit.keychord_press(Current_pane.editor_state, chord, key)
    end
    else
    -- editors hidden
    if car.keychord_press then car.keychord_press(chord, key) end
    if car.keypressed then car.keypressed(key) end
  • edit in 0012-on.draw at line 5
    [16.905]
    [17.8224]
    App.color(Foreground_color)
    if car.draw then car.draw() end -- off canvas
  • replacement in 0004-on.update at line 1
    [6.1708][6.1709:1732]()
    on.update = function()
    [6.1708]
    [6.1732]
    on.update = function(dt)
  • edit in 0004-on.update at line 11
    [6.1677]
    [6.1677]
    if car.update then car.update(dt) end