There might be different ways, But my attemp for an example, to use the TAB key to move between editboxes, on Windows
// Project: Test Tab editboxes
// Created: 20-07-04
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Test Tab editboxes" )
SetWindowSize( 1280, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1280,720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 )
#constant ebtotal 4 // total editboxes
type eboxes
id as integer
ebid as integer
endtype
global eb as eboxes[ebtotal]
global mainwin_text as integer[ebtotal]
global mainwin_editbox as integer[ebtotal]
global mainwin_eb1 as integer
global mainwin_eb2 as integer
global mainwin_eb3 as integer
global mainwin_eb4 as integer
create_editboxes()
//KEY_TAB 9
//KEY_ENTER 13
//KEY_SHIFT 16
//CHANGE THIS FOR THE TAB ORDER
eb[1].id=1
eb[1].ebid = mainwin_eb1
eb[2].id=2
eb[2].ebid = mainwin_eb2
eb[3].id=3
eb[3].ebid = mainwin_eb3
eb[4].id=4
eb[4].ebid = mainwin_eb4
ebnum as integer = 1
seteditboxfocus(eb[ebnum].ebid,1)
do
if GetRawKeyPressed(9)
inc ebnum
if ebnum > ebtotal
ebnum = 1
endif
if ebnum > 1
SetEditBoxFocus(eb[ebnum-1].ebid,0)
endif
SetEditBoxFocus(eb[ebnum].ebid,1)
endif
Print( ScreenFPS() )
Sync()
loop
function create_editboxes()
mainwin_editbox[1] = CreateEditBox()
SetEditBoxText(mainwin_editbox[1],"")
mainwin_eb1 = mainwin_editbox[1]
SetEditBoxPosition(mainwin_editbox[1],224.000000,96.000000)
SetEditBoxSize(mainwin_editbox[1],408.658325,40.000000)
SetEditBoxCursorColor(mainwin_editbox[1],0,0,0)
SetEditBoxTextSize(mainwin_editbox[1],40.000000)
SetEditBoxBorderSize(mainwin_editbox[1],2)
SetEditBoxCursorWidth(mainwin_editbox[1],2)
SetEditBoxDepth(mainwin_editbox[1],9)
SetEditBoxVisible(mainwin_editbox[1],1)
mainwin_editbox[2] = CreateEditBox()
SetEditBoxText(mainwin_editbox[2],"")
mainwin_eb2 = mainwin_editbox[2]
SetEditBoxPosition(mainwin_editbox[2],224.000000,160.000000)
SetEditBoxSize(mainwin_editbox[2],403.506256,40.000000)
SetEditBoxCursorColor(mainwin_editbox[2],0,0,0)
SetEditBoxTextSize(mainwin_editbox[2],40.000000)
SetEditBoxBorderSize(mainwin_editbox[2],2)
SetEditBoxCursorWidth(mainwin_editbox[2],2)
SetEditBoxDepth(mainwin_editbox[2],9)
SetEditBoxVisible(mainwin_editbox[2],1)
mainwin_editbox[3] = CreateEditBox()
SetEditBoxText(mainwin_editbox[3],"")
mainwin_eb3 = mainwin_editbox[3]
SetEditBoxPosition(mainwin_editbox[3],224.000000,224.000000)
SetEditBoxSize(mainwin_editbox[3],400.930237,40.000000)
SetEditBoxCursorColor(mainwin_editbox[3],0,0,0)
SetEditBoxTextSize(mainwin_editbox[3],40.000000)
SetEditBoxBorderSize(mainwin_editbox[3],2)
SetEditBoxCursorWidth(mainwin_editbox[3],2)
SetEditBoxDepth(mainwin_editbox[3],9)
SetEditBoxVisible(mainwin_editbox[3],1)
mainwin_editbox[4] = CreateEditBox()
SetEditBoxText(mainwin_editbox[4],"")
mainwin_eb4 = mainwin_editbox[4]
SetEditBoxPosition(mainwin_editbox[4],800.000000,96.000000)
SetEditBoxSize(mainwin_editbox[4],394.490173,40.000000)
SetEditBoxCursorColor(mainwin_editbox[4],0,0,0)
SetEditBoxTextSize(mainwin_editbox[4],40.000000)
SetEditBoxBorderSize(mainwin_editbox[4],2)
SetEditBoxCursorWidth(mainwin_editbox[4],2)
SetEditBoxDepth(mainwin_editbox[4],9)
SetEditBoxVisible(mainwin_editbox[4],1)
mainwin_text[1] = CreateText( "Edit(1)" )
SetTextPosition(mainwin_text[1],64.000000,96.000000)
SetTextSize(mainwin_text[1],40.000000)
SetTextDepth(mainwin_text[1],9)
SetTextVisible(mainwin_text[1],1)
mainwin_text[2] = CreateText( "Edit(2)" )
SetTextPosition(mainwin_text[2],64.000000,160.000000)
SetTextSize(mainwin_text[2],40.000000)
SetTextDepth(mainwin_text[2],9)
SetTextVisible(mainwin_text[2],1)
mainwin_text[3] = CreateText( "Edit(3)" )
SetTextPosition(mainwin_text[3],64.000000,224.000000)
SetTextSize(mainwin_text[3],40.000000)
SetTextDepth(mainwin_text[3],9)
SetTextVisible(mainwin_text[3],1)
mainwin_text[4] = CreateText( "Edit(4)" )
SetTextPosition(mainwin_text[4],672.000000,96.000000)
SetTextSize(mainwin_text[4],40.000000)
SetTextDepth(mainwin_text[4],9)
SetTextVisible(mainwin_text[4],1)
endfunction
Cherio