mirror of
				https://github.com/kepler155c/opus
				synced 2025-10-31 15:43:00 +00:00 
			
		
		
		
	format and installer branches
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| _G.requireInjector(_ENV) | ||||
|  | ||||
| --[[ | ||||
|   Adds a task and the control-d hotkey to view the kernel log. | ||||
| 	Adds a task and the control-d hotkey to view the kernel log. | ||||
| --]] | ||||
|  | ||||
| local kernel     = _G.kernel | ||||
| @@ -10,42 +10,46 @@ local multishell = _ENV.multishell | ||||
| local os         = _G.os | ||||
| local term       = _G.term | ||||
|  | ||||
| local routine = kernel.getCurrent() | ||||
| if multishell then | ||||
|   multishell.setTitle(multishell.getCurrent(), 'System Log') | ||||
|   multishell.hideTab(routine.uid) | ||||
| local function systemLog() | ||||
| 	local routine = kernel.getCurrent() | ||||
|  | ||||
| 	local w, h = kernel.window.getSize() | ||||
| 	kernel.window.reposition(1, 2, w, h - 1) | ||||
|  | ||||
| 	routine.terminal = kernel.window | ||||
| 	routine.window = kernel.window | ||||
| 	term.redirect(kernel.window) | ||||
|  | ||||
| 	kernel.hook('mouse_scroll', function(_, eventData) | ||||
| 		local dir, y = eventData[1], eventData[3] | ||||
|  | ||||
| 		if y > 1 then | ||||
| 			local currentTab = kernel.getFocused() | ||||
| 			if currentTab.terminal.scrollUp and not currentTab.terminal.noAutoScroll then | ||||
| 				if dir == -1 then | ||||
| 					currentTab.terminal.scrollUp() | ||||
| 				else | ||||
| 					currentTab.terminal.scrollDown() | ||||
| 				end | ||||
| 			end | ||||
| 		end | ||||
| 	end) | ||||
|  | ||||
| 	keyboard.addHotkey('control-d', function() | ||||
| 		local current = kernel.getFocused() | ||||
| 		if current.uid ~= routine.uid then | ||||
| 			kernel.raise(routine.uid) | ||||
| 		elseif kernel.routines[2] then | ||||
| 			kernel.raise(kernel.routines[2].uid) | ||||
| 		end | ||||
| 	end) | ||||
|  | ||||
| 	os.pullEventRaw('terminate') | ||||
| 	keyboard.removeHotkey('control-d') | ||||
| end | ||||
|  | ||||
| local w, h = kernel.window.getSize() | ||||
| kernel.window.reposition(1, 2, w, h - 1) | ||||
|  | ||||
| routine.terminal = kernel.window | ||||
| routine.window = kernel.window | ||||
| term.redirect(kernel.window) | ||||
|  | ||||
| kernel.hook('mouse_scroll', function(_, eventData) | ||||
|   local dir, y = eventData[1], eventData[3] | ||||
|  | ||||
|   if y > 1 then | ||||
|     local currentTab = kernel.getFocused() | ||||
|     if currentTab.terminal.scrollUp and not currentTab.terminal.noAutoScroll then | ||||
|       if dir == -1 then | ||||
|         currentTab.terminal.scrollUp() | ||||
|       else | ||||
|         currentTab.terminal.scrollDown() | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end) | ||||
|  | ||||
| keyboard.addHotkey('control-d', function() | ||||
|   local current = kernel.getFocused() | ||||
|   if current.uid ~= routine.uid then | ||||
|     kernel.raise(routine.uid) | ||||
|   elseif kernel.routines[2] then | ||||
|     kernel.raise(kernel.routines[2].uid) | ||||
|   end | ||||
| end) | ||||
|  | ||||
| os.pullEventRaw('terminate') | ||||
| keyboard.removeHotkey('control-d') | ||||
| multishell.openTab({ | ||||
| 	title = 'System Log', | ||||
| 	fn = systemLog, | ||||
| 	hidden = true, | ||||
| }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 kepler155c@gmail.com
					kepler155c@gmail.com