Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux version 1.0.5 released
#1
Version 1.0.5 is now available at http://naalaa.com/release/naalaa6_1.0.5_x86_64.tar.gz.

Thanks to cvirus, the 'download' function now works on Linux! Here's an example program that downloads and displays an image from naalaa.com:


Code:
' ==============================================================================
' ex3_download
' ==============================================================================

set redraw off

' Try to download an image from naalaa.com.
if download("http://naalaa.com/tmp/dl_test.png", "downloaded.png", 64000, 0)
    ' Try to load the image.
    load image 0, "downloaded.png"
    if image(0)
        ' Scale it to fit the window.
        pw# = float(width(primary))
        ph# = float(height(primary))
        translate pw*0.5, ph*0.5
        scale pw/float(width(0)), ph/float(height(0))
        draw image 0
        wln "Downloaded image ..."
    else
        wln "Could not open the downloaded image"
    endif
else
    wln "Could not download the image."
endif

do
    redraw
    wait 16
until keydown(27, true)

Note that you can also use 'download' to communicate with a server using, for example, php scripts. In that case, the downloaded file will be a regular text file.

The two 'set mouse' commands, for hiding/showing and positioning the mouse cursor, also works on Linux now. Here's an example:

Code:
' ==============================================================================
' ex3_mouse_hijacking
' ==============================================================================

set redraw off
mouseHidden = false
do
    ' Center mouse on left click.
    if mousebutton(0, true)
        set mouse 320, 240
    endif
    ' Hide/show mouse on right click.
    if mousebutton(1, true)
        if mouseHidden
            mouseHidden = false
            set mouse true
        else
            mouseHidden = true
            set mouse false
        endif
    endif

    set color 0, 0, 0
    cls

    set color 128, 128, 128
    draw line 0, 240, 640, 240
    draw line 320, 0, 320, 480

    set color 255, 255, 255
    set caret 0, 0
    wln "Left click to center mouse"
    wln "Right click to toggle mouse visibility"
    wln
    wln "Press Esc to exit"

    redraw
    wait 16
until keydown(27, true)


'download' and the 'set mouse' commands works on Windows too, of course Smile
Reply
#2
Brilliant!! Both programs ran like a charm... Thanks guys!! (Linux Mint 18.1 - 64 bit)

J
Reply
#3
Hey cool :-), i tested the first example and it worked nice :-). The mouse is hidden with the right click but the left click did not do anything :-(, Ubuntu 64bits 18 LTS.
Reply
#4
(05-29-2018, 08:56 AM)cvirus Wrote: Hey cool :-), i tested the first example and it worked nice :-). The mouse is hidden with the right click but the left click did not do anything :-(, Ubuntu 64bits 18 LTS.

That's weird, I'll have a look at it Smile

I can probably google this, but does that version use X11 or Wayland?
Reply
#5
Well it looks like both are in the Bionic Beaver 18.04LTS but the default is the Xorg so it's X11. I tested this in a VM, i will try it later with a normal installation.
Reply
#6
(05-29-2018, 01:04 PM)cvirus Wrote: Well it looks like both are in the Bionic Beaver 18.04LTS but the default is the Xorg so it's X11. I tested this in a VM, i will try it later with a normal installation.

I've read about issues with XWarpPointer (which is the function I'm using) in VirtualBox, if that's what you're using.
Reply
#7
No I'm using VMware Player, but it must be the VM that is causing the issue cause J is using Mint that is a Ubuntu flavor and he did not report any issue.
Reply
#8
(05-29-2018, 02:38 PM)cvirus Wrote: No I'm using VMware Player, but it must be the VM that is causing the issue cause J is using Mint that is a Ubuntu flavor and he did not report any issue.

Yeah, it's a known issue for vmware too, just read about it Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)